diff options
Diffstat (limited to 'tests/parseExpr.test')
-rw-r--r-- | tests/parseExpr.test | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/tests/parseExpr.test b/tests/parseExpr.test index c1c489b..714c45b 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -11,6 +11,9 @@ package require tcltest 2 namespace import ::tcltest::* +::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] + # Note that the Tcl expression parser (tclCompExpr.c) does not check # the semantic validity of the expressions it parses. It does not check, # for example, that a math function actually exists, or that the operands @@ -1017,39 +1020,48 @@ 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 * + catch {testexprparser nan!() -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR MISSING} 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 * + catch {testexprparser 1.3_() -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADCHAR} test parseExpr-22.11 {Bug 3401704} -constraints testexprparser -body { - testexprparser 1e-3_() -1 -} -returnCodes error -match glob -result * + catch {testexprparser 1e-3_() -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADCHAR} test parseExpr-22.12 {Bug 3401704} -constraints testexprparser -body { - testexprparser naneq() -1 -} -returnCodes error -match glob -result * + catch {testexprparser naneq() -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR EMPTY} 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*} + catch {testexprparser 08 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.15 {Bug 3401704} -constraints testexprparser -body { - testexprparser 0o8 -1 -} -returnCodes error -match glob -result {*invalid octal number*} + catch {testexprparser 0o8 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.16 {Bug 3401704} -constraints testexprparser -body { - testexprparser 0o08 -1 -} -returnCodes error -match glob -result {*invalid octal number*} + catch {testexprparser 0o08 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER OCTAL} test parseExpr-22.17 {Bug 3401704} -constraints testexprparser -body { - testexprparser 0b2 -1 -} -returnCodes error -match glob -result {*invalid binary number*} + catch {testexprparser 0b2 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER BINARY} test parseExpr-22.18 {Bug 3401704} -constraints testexprparser -body { - testexprparser 0b02 -1 -} -returnCodes error -match glob -result {*invalid binary number*} + catch {testexprparser 0b02 -1} m o + dict get $o -errorcode +} -result {TCL PARSE EXPR BADNUMBER BINARY} # cleanup |