diff options
author | Steve Bennett <steveb@workware.net.au> | 2021-07-09 08:31:54 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2021-07-09 08:32:46 +1000 |
commit | a5133340116856194632becc4146f3f888018d23 (patch) | |
tree | 721543c92807521a2b14653ffc580c93c98af762 /tests | |
parent | 500866719dde1cb03d87b550cc8998b31d9e1316 (diff) | |
download | jimtcl-a5133340116856194632becc4146f3f888018d23.zip jimtcl-a5133340116856194632becc4146f3f888018d23.tar.gz jimtcl-a5133340116856194632becc4146f3f888018d23.tar.bz2 |
tests: move garabage collection test to ref.test
bootstrap jimsh doesn't have garbage collection, so move
such tests into ref.test
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/alias.test | 17 | ||||
-rw-r--r-- | tests/ref.test | 24 |
2 files changed, 24 insertions, 17 deletions
diff --git a/tests/alias.test b/tests/alias.test index 9ad2dfd..00870d1 100644 --- a/tests/alias.test +++ b/tests/alias.test @@ -265,21 +265,4 @@ test upcall-1.6 {delete local command with upcall} -body { rename a c } -returnCodes error -result {can't rename local command "a"} -test collect-1.1 {ensure globally scoped references are deleted} { - collect - set result {} - - # Create a globally scoped reference as a function name - set a ::[ref testfunction -] - proc $a {} { return 3 } - lappend result [$a] - # It shouldn't be collected - lappend result [collect] - lappend result [$a] - unset a - # Now it should be collected - lappend result [collect] - set result -} {3 0 3 1} - testreport diff --git a/tests/ref.test b/tests/ref.test new file mode 100644 index 0000000..7a38142 --- /dev/null +++ b/tests/ref.test @@ -0,0 +1,24 @@ +source [file dirname [info script]]/testing.tcl + +needs constraint jim +needs cmd ref +needs cmd collect + +test collect-1.1 {ensure globally scoped references are deleted} { + collect + set result {} + + # Create a globally scoped reference as a function name + set a ::[ref testfunction -] + proc $a {} { return 3 } + lappend result [$a] + # It shouldn't be collected + lappend result [collect] + lappend result [$a] + unset a + # Now it should be collected + lappend result [collect] + set result +} {3 0 3 1} + +testreport |