diff options
Diffstat (limited to 'tests/parseExpr.test')
| -rw-r--r-- | tests/parseExpr.test | 74 |
1 files changed, 69 insertions, 5 deletions
diff --git a/tests/parseExpr.test b/tests/parseExpr.test index 7673dbe..c3b0d71 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -8,10 +8,8 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest 2 - namespace import -force ::tcltest::* -} +package require tcltest 2 +namespace import ::tcltest::* # Note that the Tcl expression parser (tclCompExpr.c) does not check # the semantic validity of the expressions it parses. It does not check, @@ -997,6 +995,72 @@ test parseExpr-21.63 {error message} -body { } -returnCodes error -result "missing close-brace in expression \"...12345678901234567890*\[\{abcdefghijklmnopqrstuv...\"" +test parseExpr-22.1 {Bug 3401704} -constraints testexprparser -body { + testexprparser 2a() 1 +} -result {- {} 0 subexpr 2 1 text 2 0 {}} +test parseExpr-22.2 {Bug 3401704} -constraints testexprparser -body { + testexprparser nana() 3 +} -result {- {} 0 subexpr nan 1 text nan 0 {}} +test parseExpr-22.3 {Bug 3401704} -constraints testexprparser -body { + testexprparser 2a() -1 +} -result {- {} 0 subexpr 2a() 1 operator 2a 0 {}} +test parseExpr-22.4 {Bug 3401704} -constraints testexprparser -body { + testexprparser nana() -1 +} -result {- {} 0 subexpr nana() 1 operator nana 0 {}} +test parseExpr-22.5 {Bug 3401704} -constraints testexprparser -body { + testexprparser nan9() -1 +} -result {- {} 0 subexpr nan9() 1 operator nan9 0 {}} +test parseExpr-22.6 {Bug 3401704} -constraints testexprparser -body { + testexprparser 2_() -1 +} -result {- {} 0 subexpr 2_() 1 operator 2_ 0 {}} +test parseExpr-22.7 {Bug 3401704} -constraints testexprparser -body { + testexprparser nan_() -1 +} -result {- {} 0 subexpr nan_() 1 operator nan_ 0 {}} +test parseExpr-22.8 {Bug 3401704} -constraints testexprparser -body { + testexprparser nan!() -1 +} -returnCodes error -match glob -result * +test parseExpr-22.9 {Bug 3401704} -constraints testexprparser -body { + testexprparser 1e3_() -1 +} -result {- {} 0 subexpr 1e3_() 1 operator 1e3_ 0 {}} +test parseExpr-22.10 {Bug 3401704} -constraints testexprparser -body { + testexprparser 1.3_() -1 +} -returnCodes error -match glob -result * +test parseExpr-22.11 {Bug 3401704} -constraints testexprparser -body { + testexprparser 1e-3_() -1 +} -returnCodes error -match glob -result * +test parseExpr-22.12 {Bug 3401704} -constraints testexprparser -body { + testexprparser naneq() -1 +} -returnCodes error -match glob -result * +test parseExpr-22.13 {Bug 3401704} -constraints testexprparser -body { + testexprparser naner() -1 +} -result {- {} 0 subexpr naner() 1 operator naner 0 {}} + +test parseExpr-22.14 {Bug 3401704} -constraints testexprparser -body { + testexprparser 08 -1 +} -returnCodes error -match glob -result {*invalid octal number*} +test parseExpr-22.15 {Bug 3401704} -constraints testexprparser -body { + testexprparser 0o8 -1 +} -returnCodes error -match glob -result {*invalid octal number*} +test parseExpr-22.16 {Bug 3401704} -constraints testexprparser -body { + testexprparser 0o08 -1 +} -returnCodes error -match glob -result {*invalid octal number*} +test parseExpr-22.17 {Bug 3401704} -constraints testexprparser -body { + testexprparser 0b2 -1 +} -returnCodes error -match glob -result {*invalid binary number*} +test parseExpr-22.18 {Bug 3401704} -constraints testexprparser -body { + testexprparser 0b02 -1 +} -returnCodes error -match glob -result {*invalid binary number*} + +test parseExpr-22.19 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser \u0433 -1 +} -returnCodes error -match glob -result {*invalid character*} +test parseExpr-22.20 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser \u043f -1 +} -returnCodes error -match glob -result {*invalid character*} +test parseExpr-22.21 {Bug d2ffcca163} -constraints testexprparser -body { + testexprparser in\u0433(0) -1 +} -returnCodes error -match glob -result {missing operand*} + # cleanup -::tcltest::cleanupTests +cleanupTests return |
