#------------------------------------------------------------------------------- # SPDX-License-Identifier: GPL-2.0-or-later #------------------------------------------------------------------------------- # props.Node.nut - Nasal Unit Test for props.Node.nas # created: 06/2020 # Copyright (C) 2020 by Henning Stahlke #------------------------------------------------------------------------------- var setUp = func { print("setUp "~caller(0)[2]~" "); }; var tearDown = func { }; var test_isValidPropName = func() { # test valid names unitTest.assert(props.Node.isValidPropName("abc123") == 1, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("_abc123") == 1, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("_1a") == 1, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("_1a.-") == 1, "isValidPropName()"); # test invalid names unitTest.assert(props.Node.isValidPropName("1a") == 0, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("abä") == 0, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("foo:bar") == 0, "isValidPropName()"); unitTest.assert(props.Node.isValidPropName("foo