summaryrefslogtreecommitdiffstats
path: root/tests/expr-old.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-01-30 20:42:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-01-30 20:42:10 (GMT)
commit4445787a0a5228ad9d533415e563d6ae0ec517bf (patch)
treefe7cda3c3a7c230ce8087e0d21f017d6aa73dd97 /tests/expr-old.test
parent6a27aae72c76f68c63aa85b9bc8f159385534102 (diff)
downloadtcl-4445787a0a5228ad9d533415e563d6ae0ec517bf.zip
tcl-4445787a0a5228ad9d533415e563d6ae0ec517bf.tar.gz
tcl-4445787a0a5228ad9d533415e563d6ae0ec517bf.tar.bz2
For Parse/eval, select modernizations from Patrick Fradin.
Diffstat (limited to 'tests/expr-old.test')
-rw-r--r--tests/expr-old.test14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/expr-old.test b/tests/expr-old.test
index c05a925..2b90a92 100644
--- a/tests/expr-old.test
+++ b/tests/expr-old.test
@@ -13,10 +13,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.1
- namespace import -force ::tcltest::*
-}
+package require tcltest 2.1
+namespace import ::tcltest::*
testConstraint testexprlong [llength [info commands testexprlong]]
testConstraint testexprdouble [llength [info commands testexprdouble]]
@@ -142,7 +140,7 @@ test expr-old-1.50 {integer operators} {expr +36} 36
test expr-old-1.51 {integer operators} {expr +--++36} 36
test expr-old-1.52 {integer operators} {expr +36%+5} 1
test expr-old-1.53 {integer operators} {
- catch {unset x}
+ unset -nocomplain x
set x yes
list [expr {1 && $x}] [expr {$x && 1}] \
[expr {0 || $x}] [expr {$x || 0}]
@@ -450,7 +448,7 @@ test expr-old-23.3 {double quotes} {
test expr-old-23.4 {double quotes} {expr {"11\}\}22"}} 11}}22
test expr-old-23.5 {double quotes} {expr {"\*bc"}} {*bc}
test expr-old-23.6 {double quotes} {
- catch {unset bogus__}
+ unset -nocomplain bogus__
list [catch {expr {"$bogus__"}} msg] $msg
} {1 {can't read "bogus__": no such variable}}
test expr-old-23.7 {double quotes} {
@@ -499,7 +497,7 @@ test expr-old-26.2 {error conditions} -body {
test expr-old-26.3 {error conditions} -body {
expr 2+4*(
} -returnCodes error -match glob -result *
-catch {unset _non_existent_}
+unset -nocomplain _non_existent_
test expr-old-26.4 {error conditions} {
list [catch {expr 2+$_non_existent_} msg] $msg
} {1 {can't read "_non_existent_": no such variable}}
@@ -578,7 +576,7 @@ test expr-old-27.4 {cancelled evaluation} {
expr {1?2:[set a 2]}
set a
} 1
-catch {unset x}
+unset -nocomplain x
test expr-old-27.5 {cancelled evaluation} {
list [catch {expr {[info exists x] && $x}} msg] $msg
} {0 0}