diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-01-04 09:08:27 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-01-15 07:14:43 +1000 |
commit | 4cc0ca3896cacbce03a545fc39a106cd75fd394d (patch) | |
tree | 65cf4314c05f440c8058d8241f5ced88be522c99 /tests/testing.tcl | |
parent | c6954336d779c7e56aa38ecd6a50ff076ecfabbb (diff) | |
download | jimtcl-4cc0ca3896cacbce03a545fc39a106cd75fd394d.zip jimtcl-4cc0ca3896cacbce03a545fc39a106cd75fd394d.tar.gz jimtcl-4cc0ca3896cacbce03a545fc39a106cd75fd394d.tar.bz2 |
tests: fix tests if tclcompat is not enabled
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/testing.tcl')
-rw-r--r-- | tests/testing.tcl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/testing.tcl b/tests/testing.tcl index 30aecee..8bfd22d 100644 --- a/tests/testing.tcl +++ b/tests/testing.tcl @@ -74,6 +74,7 @@ lappend auto_path $testdir $bindir [file dirname [pwd]] # For Jim, this is reasonable compatible tcltest proc makeFile {contents name} { set f [open $name w] + stdout puts "About to 'puts $f $contents'" puts $f $contents close $f return $name @@ -83,6 +84,23 @@ proc removeFile {name} { file delete $name } +# In case tclcompat is not selected +if {![exists -proc puts]} { + proc puts {{-nonewline {}} {chan stdout} msg} { + if {${-nonewline} ni {-nonewline {}}} { + ${-nonewline} puts $msg + } else { + $chan puts {*}${-nonewline} $msg + } + } + proc close {chan args} { + $chan close {*}$args + } + proc fileevent {args} { + {*}$args + } +} + proc script_source {script} { lassign [info source $script] f l if {$f ne ""} { |