diff options
author | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
commit | 494c2de3a748b449c69ce322a1a741f5a31fd4d5 (patch) | |
tree | c3ece48c0ae3f4ba54787e0e8e729b65752ef3f9 /tests/compile.test | |
parent | 7a698c0488d99c0af42022714638ae1ba2afaa49 (diff) | |
download | tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.zip tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.gz tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.bz2 |
Added contents of Tcl 8.1a2
Diffstat (limited to 'tests/compile.test')
-rw-r--r-- | tests/compile.test | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tests/compile.test b/tests/compile.test index 9e30fb3..53dc3d8 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# SCCS: @(#) compile.test 1.7 97/08/12 13:34:13 +# SCCS: @(#) compile.test 1.9 97/12/16 13:32:14 if {[string compare test [info procs test]] == 1} then {source defs} @@ -69,7 +69,17 @@ test compile-2.4 {TclCompileDollarVar: global scalar name with ::s} { list [p] $::a(1) [expr {[lsearch -exact [info globals] a] != 0}] } {1 1 1} -test compile-3.1 {TclCompileSetCmd: global scalar names with ::s} { +test compile-3.1 {TclCompileCatchCmd: only catch cmds with scalar vars are compiled inline} { + catch {unset a} + set a(1) xyzzyx + proc p {} { + global a + catch {set x 123} a(1) + } + list [p] $a(1) +} {0 123} + +test compile-4.1 {TclCompileSetCmd: global scalar names with ::s} { catch {unset x} catch {unset y} set x 123 @@ -80,7 +90,7 @@ test compile-3.1 {TclCompileSetCmd: global scalar names with ::s} { list $::x [expr {[lsearch -exact [info globals] x] != 0}] \ [p] $::y [expr {[lsearch -exact [info globals] y] != 0}] } {123 1 789 789 1} -test compile-3.2 {TclCompileSetCmd: global array names with ::s} { +test compile-4.2 {TclCompileSetCmd: global array names with ::s} { catch {unset a} set ::a(1) 2 proc p {} { @@ -89,7 +99,7 @@ test compile-3.2 {TclCompileSetCmd: global array names with ::s} { } list $::a(1) [p] [set ::a($::a(1)) 3] $::a(1) [expr {[lsearch -exact [info globals] a] != 0}] } {2 1 3 3 1} -test compile-3.3 {TclCompileSetCmd: namespace var names with ::s} { +test compile-4.3 {TclCompileSetCmd: namespace var names with ::s} { catch {namespace delete test_ns_compile} catch {unset x} namespace eval test_ns_compile { @@ -101,17 +111,17 @@ test compile-3.3 {TclCompileSetCmd: namespace var names with ::s} { list $::x $::test_ns_compile::arr(1) } {hello 123} -test compile-4.1 {CollectArgInfo: binary data} { +test compile-5.1 {CollectArgInfo: binary data} { list [catch "string length \000foo" msg] $msg } {0 4} -test compile-4.2 {CollectArgInfo: binary data} { +test compile-5.2 {CollectArgInfo: binary data} { list [catch "string length foo\000" msg] $msg } {0 4} -test compile-4.3 {CollectArgInfo: handle "]" at end of command properly} { +test compile-5.3 {CollectArgInfo: handle "]" at end of command properly} { set x ] } {]} -test compile-5.1 {UpdateStringOfByteCode: called for duplicate of compiled empty object} { +test compile-6.1 {UpdateStringOfByteCode: called for duplicate of compiled empty object} { proc p {} { set x {} eval $x @@ -126,3 +136,5 @@ catch {namespace delete test_ns_compile} catch {unset x} catch {unset y} catch {unset a} + +return |