summaryrefslogtreecommitdiffstats
path: root/tests/parseExpr.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parseExpr.test')
-rw-r--r--tests/parseExpr.test57
1 files changed, 22 insertions, 35 deletions
diff --git a/tests/parseExpr.test b/tests/parseExpr.test
index fda25b7..c3b0d71 100644
--- a/tests/parseExpr.test
+++ b/tests/parseExpr.test
@@ -11,16 +11,12 @@
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
# of "<<" are integers.
testConstraint testexprparser [llength [info commands testexprparser]]
-testConstraint testbytestring [llength [info commands testbytestring]]
# Big test for correct ordering of data in [expr]
@@ -82,8 +78,8 @@ testConstraint ieeeFloatingPoint [testIEEE]
######################################################################
-test parseExpr-1.1 {Tcl_ParseExpr procedure, computing string length} {testexprparser testbytestring} {
- testexprparser [testbytestring "1+2\0 +3"] -1
+test parseExpr-1.1 {Tcl_ParseExpr procedure, computing string length} testexprparser {
+ testexprparser [bytestring "1+2\0 +3"] -1
} {- {} 0 subexpr 1+2 5 operator + 0 subexpr 1 1 text 1 0 subexpr 2 1 text 2 0 {}}
test parseExpr-1.2 {Tcl_ParseExpr procedure, computing string length} testexprparser {
testexprparser "1 + 2" -1
@@ -768,11 +764,11 @@ test parseExpr-21.8 {error messages} -body {
expr {0o8x}
} -returnCodes error -match glob -result {*invalid octal number*}
test parseExpr-21.9 {error messages} -body {
- expr {"}
+ expr {"}
} -returnCodes error -result {missing "
in expression """}
test parseExpr-21.10 {error messages} -body {
- expr \{
+ expr \{
} -returnCodes error -result "missing close-brace
in expression \"\{\""
test parseExpr-21.11 {error messages} -body {
@@ -1021,48 +1017,39 @@ 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 {
- catch {testexprparser 08 -1} m o
- dict get $o -errorcode
-} -result {TCL PARSE EXPR BADNUMBER OCTAL}
+ testexprparser 08 -1
+} -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