diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 11:32:03 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:41 +1000 |
commit | c5bf0eb2d41b437999394486dc4d7eace5dc0c27 (patch) | |
tree | 25a42d2f8a8e2419be8503c2fece94ff917e7a9d /tests | |
parent | b0950211281e786a633692eee2a4096e8457ed82 (diff) | |
download | jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.zip jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.tar.gz jimtcl-c5bf0eb2d41b437999394486dc4d7eace5dc0c27.tar.bz2 |
Bug fixes, documentation updates
jimsh - retry on EINTR from fgets()
Fix 0 -> NULL for 64 bit systems
Fix overlapping memcpy
Fix jim array dereferencing bug
*: Counting of parentheses was incorrect with nested array references
*: The result for array dereference wasn't being used properly
Add os.uptime command
Documentation: autogenerated command index
Fix gets when last line has no newline
Diffstat (limited to 'tests')
-rw-r--r-- | tests/misc.test | 24 | ||||
-rw-r--r-- | tests/testing.tcl | 4 | ||||
-rw-r--r-- | tests/testio.in | 2 |
3 files changed, 28 insertions, 2 deletions
diff --git a/tests/misc.test b/tests/misc.test new file mode 100644 index 0000000..fec7feb --- /dev/null +++ b/tests/misc.test @@ -0,0 +1,24 @@ +source testing.tcl + +section "Regression Testing" + +test regr-1.1 "Double dereference arrays" { + array set a {one ONE two TWO three THREE} + array set b {ONE 1 TWO 2 THREE 3} + set chan two + set b($a($chan)) +} {2} + +section "I/O Testing" + +test io-1.1 "Read last line with no newline" { + set lines 0 + set f [open testio.in] + while {[gets $f buf] >= 0} { + incr lines + } + close $f + list $lines +} {2} + +testreport diff --git a/tests/testing.tcl b/tests/testing.tcl index 9f5ffa3..e86830c 100644 --- a/tests/testing.tcl +++ b/tests/testing.tcl @@ -4,13 +4,13 @@ # e.g. bio copy [autoopen infile] [autoopen outfile w]; collect # proc autoopen {filename {mode r}} { - set ref [ref [open $filename $mode] aio lambdaFinalizer] + set ref [ref [open.old $filename $mode] aio lambdaFinalizer] rename [getref $ref] $ref return $ref } # And make autoopen the standard open -rename open "" +rename open open.old rename autoopen open # Hardly needed diff --git a/tests/testio.in b/tests/testio.in new file mode 100644 index 0000000..f664859 --- /dev/null +++ b/tests/testio.in @@ -0,0 +1,2 @@ +One line here
+^
\ No newline at end of file |