diff options
author | hobbs <hobbs> | 2000-04-04 08:05:18 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-04-04 08:05:18 (GMT) |
commit | 8977ea94f9e8853776ebf09fe56d7be111450019 (patch) | |
tree | 00ceac2b3c276f9d6db33da471db0ee5b4fce6bb /tests | |
parent | 48e18ca0cc7a2edcc8320b4e33e31faaa768a64a (diff) | |
download | tcl-8977ea94f9e8853776ebf09fe56d7be111450019.zip tcl-8977ea94f9e8853776ebf09fe56d7be111450019.tar.gz tcl-8977ea94f9e8853776ebf09fe56d7be111450019.tar.bz2 |
* tests/foreach.test:
* tests/namespace.test:
* tests/var.test: Added lsorts to avoid random sorted return
problems. [Bug: 2682]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fileName.test | 6 | ||||
-rw-r--r-- | tests/foreach.test | 6 | ||||
-rw-r--r-- | tests/namespace.test | 26 | ||||
-rw-r--r-- | tests/var.test | 32 |
4 files changed, 35 insertions, 35 deletions
diff --git a/tests/fileName.test b/tests/fileName.test index 91c5cda..989299b 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.6 1999/12/12 22:46:47 hobbs Exp $ +# RCS: @(#) $Id: fileName.test,v 1.7 2000/04/04 08:05:18 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1322,10 +1322,10 @@ test filename-13.22 {globbing with brace substitution} { } {1 {unmatched open-brace in file name}} test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { - lsort [glob g*/*.c] + lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.2 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob g*/*.c] + lsort [glob glo*/*.c] } {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/?1.c] diff --git a/tests/foreach.test b/tests/foreach.test index 5a13035..5f122a9 100644 --- a/tests/foreach.test +++ b/tests/foreach.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: foreach.test,v 1.4 1999/06/26 03:54:14 jenn Exp $ +# RCS: @(#) $Id: foreach.test,v 1.5 2000/04/04 08:05:18 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -157,8 +157,8 @@ test foreach-3.1 {compiled foreach backward jump works correctly} { return $l } array set x {0 zero 1 one 2 two 3 three} - foo x -} {{0 zero} {1 one} {2 two} {3 three}} + lsort [foo x] +} [lsort {{0 zero} {1 one} {2 two} {3 three}}] test foreach-4.1 {noncompiled foreach and shared variable or value list objects that are converted to another type} { catch {unset x} diff --git a/tests/namespace.test b/tests/namespace.test index 7f855c9..3a2ef1e 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: namespace.test,v 1.10 2000/03/27 22:19:14 hobbs Exp $ +# RCS: @(#) $Id: namespace.test,v 1.11 2000/04/04 08:05:19 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -103,8 +103,8 @@ test namespace-6.4 {Tcl_CreateNamespace, trailing ::s in ns name are ignored} { namespace eval test_ns_2:: {} namespace eval test_ns_3:: {} } - namespace children ::test_ns_1 -} {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_3} + lsort [namespace children ::test_ns_1] +} [lsort {::test_ns_1::test_ns_2 ::test_ns_1::test_ns_3}] test namespace-6.5 {Tcl_CreateNamespace, relative ns names now only looked up in current ns} { set trigger { namespace eval test_ns_2 {namespace current} @@ -189,10 +189,10 @@ test namespace-8.4 {TclTeardownNamespace, cmds imported from deleted ns go away} namespace import ::test_ns_export::* proc p {} {return foo} } - list [info commands test_ns_import::*] \ + list [lsort [info commands test_ns_import::*]] \ [namespace delete test_ns_export] \ [info commands test_ns_import::*] -} {{::test_ns_import::p ::test_ns_import::cmd1 ::test_ns_import::cmd2} {} ::test_ns_import::p} +} [list [lsort {::test_ns_import::p ::test_ns_import::cmd1 ::test_ns_import::cmd2}] {} ::test_ns_import::p] test namespace-9.1 {Tcl_Import, empty import pattern} { catch {eval namespace delete [namespace children :: test_ns_*]} @@ -263,12 +263,12 @@ test namespace-10.3 {Tcl_ForgetImport, deletes matching imported cmds} { namespace import ::test_ns_export::* proc p {} {return [cmd1 123]} set l {} - lappend l [info commands ::test_ns_import::*] + lappend l [lsort [info commands ::test_ns_import::*]] namespace forget ::test_ns_export::cmd1 lappend l [info commands ::test_ns_import::*] lappend l [catch {cmd1 777} msg] $msg } -} {{::test_ns_import::p ::test_ns_import::cmd1} ::test_ns_import::p 1 {invalid command name "cmd1"}} +} [list [lsort {::test_ns_import::p ::test_ns_import::cmd1}] ::test_ns_import::p 1 {invalid command name "cmd1"}] test namespace-11.1 {TclGetOriginalCommand, check if not imported cmd} { catch {eval namespace delete [namespace children :: test_ns_*]} @@ -326,9 +326,9 @@ test namespace-14.1 {TclGetNamespaceForQualName, absolute names} { } namespace eval test_ns_1 { list $::v $::test_ns_2::v $::test_ns_1::test_ns_2::v \ - [namespace children :: test_ns_*] + [lsort [namespace children :: test_ns_*]] } -} {10 30 20 {::test_ns_1 ::test_ns_2}} +} [list 10 30 20 [lsort {::test_ns_1 ::test_ns_2}]] test namespace-14.2 {TclGetNamespaceForQualName, invalid absolute names} { namespace eval test_ns_1 { list [catch {set ::test_ns_777::v} msg] $msg \ @@ -801,8 +801,8 @@ test namespace-26.5 {NamespaceExportCmd, sequence of patterns, patterns accumula namespace eval test_ns_2 { namespace import -force ::test_ns_1::* } - list [info commands test_ns_2::*] [test_ns_2::cmd3 hello] -} {{::test_ns_2::cmd1 ::test_ns_2::cmd3} {cmd3: hello}} + list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd3 hello] +} [list [lsort {::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd3: hello}] test namespace-26.6 {NamespaceExportCmd, no patterns means return uniq'ed export list} { namespace eval test_ns_1 { namespace export @@ -815,8 +815,8 @@ test namespace-26.7 {NamespaceExportCmd, -clear resets export list} { namespace eval test_ns_2 { namespace import ::test_ns_1::* } - list [info commands test_ns_2::*] [test_ns_2::cmd4 hello] -} {{::test_ns_2::cmd4 ::test_ns_2::cmd1 ::test_ns_2::cmd3} {cmd4: hello}} + list [lsort [info commands test_ns_2::*]] [test_ns_2::cmd4 hello] +} [list [lsort {::test_ns_2::cmd4 ::test_ns_2::cmd1 ::test_ns_2::cmd3}] {cmd4: hello}] test namespace-27.1 {NamespaceForgetCmd, no args} { catch {eval namespace delete [namespace children :: test_ns_*]} diff --git a/tests/var.test b/tests/var.test index c4bb0c5..d7496f6 100644 --- a/tests/var.test +++ b/tests/var.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: var.test,v 1.13 2000/01/21 03:29:14 ericm Exp $ +# RCS: @(#) $Id: var.test,v 1.14 2000/04/04 08:05:19 hobbs Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -343,16 +343,16 @@ test var-7.3 {Tcl_VariableObjCmd, "define" var already created above} { namespace eval test_ns_var { variable two 2 } - list [info vars test_ns_var::*] \ + list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {set two}] -} {{::test_ns_var::two ::test_ns_var::one} 2} +} [list [lsort {::test_ns_var::two ::test_ns_var::one}] 2] test var-7.4 {Tcl_VariableObjCmd, list of vars} { namespace eval test_ns_var { variable three 3 four 4 } - list [info vars test_ns_var::*] \ + list [lsort [info vars test_ns_var::*]] \ [namespace eval test_ns_var {expr $three+$four}] -} {{::test_ns_var::four ::test_ns_var::three ::test_ns_var::two ::test_ns_var::one} 7} +} [list [lsort {::test_ns_var::four ::test_ns_var::three ::test_ns_var::two ::test_ns_var::one}] 7] test var-7.5 {Tcl_VariableObjCmd, value for last var is optional} { catch {unset a} catch {unset five} @@ -401,28 +401,28 @@ test var-7.9 {Tcl_VariableObjCmd, mark as namespace var so var persists until na variable y variable z } - lappend a [info vars test_ns_var2::*] + lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::x] [info exists test_ns_var2::y] \ [info exists test_ns_var2::z] lappend a [list [catch {set test_ns_var2::y} msg] $msg] - lappend a [info vars test_ns_var2::*] + lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [set test_ns_var2::y hello] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [list [catch {unset test_ns_var2::y} msg] $msg] - lappend a [info vars test_ns_var2::*] + lappend a [lsort [info vars test_ns_var2::*]] lappend a [info exists test_ns_var2::y] [info exists test_ns_var2::z] lappend a [list [catch {unset test_ns_var2::z} msg] $msg] lappend a [namespace delete test_ns_var2] set a -} {{::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z} 1 0 0\ -{1 {can't read "test_ns_var2::y": no such variable}}\ -{::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z} 0 0\ -hello 1 0\ -{0 {}}\ -{::test_ns_var2::x ::test_ns_var2::z} 0 0\ -{1 {can't unset "test_ns_var2::z": no such variable}}\ -{}} +} [list [lsort {::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z}] 1 0 0\ + {1 {can't read "test_ns_var2::y": no such variable}}\ + [lsort {::test_ns_var2::x ::test_ns_var2::y ::test_ns_var2::z}] 0 0\ + hello 1 0\ + {0 {}}\ + [lsort {::test_ns_var2::x ::test_ns_var2::z}] 0 0\ + {1 {can't unset "test_ns_var2::z": no such variable}}\ + {}] test var-7.10 {Tcl_VariableObjCmd, variable cmd inside proc creates local link var} { namespace eval test_ns_var { proc p {} { |