summaryrefslogtreecommitdiffstats
path: root/tests/compile.test
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2022-08-31 14:28:57 (GMT)
committerkjnash <k.j.nash@usa.net>2022-08-31 14:28:57 (GMT)
commit19f8c3bb6b2aa8d571a7534b588ddacfb49952d3 (patch)
tree5051f34456c20c798d30e7741fae52575927fd7a /tests/compile.test
parentd9b5be0959a8ee2b81ba519ff3d4c70b2da9a6ce (diff)
parentff1e919a1bae9ff88ab6dbc094b18cfadedfe8af (diff)
downloadtcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.zip
tcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.tar.gz
tcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.tar.bz2
Merge old 8.7 674a6ad0472c7
Diffstat (limited to 'tests/compile.test')
-rw-r--r--tests/compile.test19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/compile.test b/tests/compile.test
index 18e978f..6eeb4fe 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -5,14 +5,17 @@
# commands. Sourcing this file into Tcl runs the tests and generates output
# for errors. No output means no errors were found.
#
-# Copyright (c) 1997 by Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright © 1997 Sun Microsystems, Inc.
+# Copyright © 1998-1999 Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
-package require tcltest 2
-namespace import -force ::tcltest::*
+if {"::tcltest" ni [namespace children]} {
+ package require tcltest 2.5
+ namespace import -force ::tcltest::*
+}
+
::tcltest::loadTestedCommands
catch [list package require -exact Tcltest [info patchlevel]]
@@ -201,7 +204,7 @@ test compile-4.1 {TclCompileForCmd: command substituted test expression} {
set i 0
set j 0
# Should be "forever"
- for {} [expr $i < 3] {} {
+ for {} [expr {$i < 3}] {} {
set j [incr i]
if {$j > 3} break
}
@@ -275,7 +278,7 @@ test compile-7.1 {TclCompileWhileCmd: command substituted test expression} {
set i 0
set j 0
# Should be "forever"
- while [expr $i < 3] {
+ while [expr {$i < 3}] {
set j [incr i]
if {$j > 3} break
}
@@ -334,7 +337,7 @@ test compile-11.6 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body {
apply {{} { set r [list foobar] ; incr}}
} -returnCodes error -result {wrong # args: should be "incr varName ?increment?"}
test compile-11.7 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body {
- apply {{} { set r [list foobar] ; expr !a }}
+ apply {{} { set r [list foobar] ; expr [concat !a] }}
} -returnCodes error -match glob -result *
test compile-11.8 {Tcl_Append*: ensure Tcl_ResetResult is used properly} -body {
apply {{} { set r [list foobar] ; expr {!a} }}
@@ -563,7 +566,7 @@ test compile-15.5 {proper TCL_RETURN code from [return]} {
# Do all tests once byte compiled and once with direct string evaluation
foreach noComp {0 1} {
-if $noComp {
+if {$noComp} {
interp alias {} run {} testevalex
set constraints testevalex
} else {