diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 11:41:46 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:42 +1000 |
commit | 48ff3a2b20e142da6a7bd2f35ba2baca0a4d33ae (patch) | |
tree | fc5291883e9d32a491647c169715dd2b100d3da7 /tests/testing.tcl | |
parent | 47a1141c88d5899325b556666dd27cc75a602b98 (diff) | |
download | jimtcl-48ff3a2b20e142da6a7bd2f35ba2baca0a4d33ae.zip jimtcl-48ff3a2b20e142da6a7bd2f35ba2baca0a4d33ae.tar.gz jimtcl-48ff3a2b20e142da6a7bd2f35ba2baca0a4d33ae.tar.bz2 |
Implement and document lassign
Diffstat (limited to 'tests/testing.tcl')
-rw-r--r-- | tests/testing.tcl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/testing.tcl b/tests/testing.tcl index 2adacdd..4956450 100644 --- a/tests/testing.tcl +++ b/tests/testing.tcl @@ -4,7 +4,7 @@ # e.g. bio copy [autoopen infile] [autoopen outfile w]; collect # proc autoopen {filename {mode r}} { - set ref [ref [open.old $filename $mode] aio lambdaFinalizer] + set ref [ref [open $filename $mode] aio lambdaFinalizer] rename [getref $ref] $ref return $ref } @@ -22,19 +22,19 @@ proc section {name} { array set testresults {numfail 0 numpass 0 failed {}} proc test {id descr script expected} { - puts -nonewline "$id " - set rc [catch {uplevel 1 $script} result] + puts -nonewline "$id " + set rc [catch {uplevel 1 $script} result] # Note that rc=2 is return - if {($rc == 0 || $rc == 2) && $result eq $expected} { + if {($rc == 0 || $rc == 2) && $result eq $expected} { puts "OK $descr" incr ::testresults(numpass) - } else { + } else { puts "ERR $descr" puts "Expected: '$expected'" - puts "Got : '$result'" + puts "Got : '$result'" incr ::testresults(numfail) - lappend ::testresults(failed) [list $id $descr $script $expected $result] - } + lappend ::testresults(failed) [list $id $descr $script $expected $result] + } } proc testreport {} { |