summaryrefslogtreecommitdiffstats
path: root/tests/parseExpr.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parseExpr.test')
-rw-r--r--tests/parseExpr.test62
1 files changed, 29 insertions, 33 deletions
diff --git a/tests/parseExpr.test b/tests/parseExpr.test
index d667bf2..c3b0d71 100644
--- a/tests/parseExpr.test
+++ b/tests/parseExpr.test
@@ -8,13 +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::*
-}
-
-::tcltest::loadTestedCommands
-catch [list package require -exact Tcltest [info patchlevel]]
+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,
@@ -1022,49 +1017,50 @@ 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 {
- catch {testexprparser nan!() -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR MISSING}
+ 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 {
- catch {testexprparser 1.3_() -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADCHAR}
+ testexprparser 1.3_() -1
+} -returnCodes error -match glob -result *
test parseExpr-22.11 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser 1e-3_() -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADCHAR}
+ testexprparser 1e-3_() -1
+} -returnCodes error -match glob -result *
test parseExpr-22.12 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser naneq() -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR EMPTY}
+ 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
-} -result {- {} 0 subexpr 08 1 text 08 0 {}}
+} -returnCodes error -match glob -result {*invalid octal number*}
test parseExpr-22.15 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser 0o8 -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADNUMBER OCTAL}
+ testexprparser 0o8 -1
+} -returnCodes error -match glob -result {*invalid octal number*}
test parseExpr-22.16 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser 0o08 -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADNUMBER OCTAL}
+ testexprparser 0o08 -1
+} -returnCodes error -match glob -result {*invalid octal number*}
test parseExpr-22.17 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser 0b2 -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADNUMBER BINARY}
+ testexprparser 0b2 -1
+} -returnCodes error -match glob -result {*invalid binary number*}
test parseExpr-22.18 {Bug 3401704} -constraints testexprparser -body {
- catch {testexprparser 0b02 -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADNUMBER BINARY}
+ 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