diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-06-05 14:42:37 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-06-05 21:48:01 +1000 |
commit | e59b23873698cd9d82e3ca8f7428f7a47d49fe60 (patch) | |
tree | d493bf7dda776e76bfd884758a41817fff4b72c3 | |
parent | cdfa4637afe510fad7140d03b154bf30b16f8f9c (diff) | |
download | jimtcl-e59b23873698cd9d82e3ca8f7428f7a47d49fe60.zip jimtcl-e59b23873698cd9d82e3ca8f7428f7a47d49fe60.tar.gz jimtcl-e59b23873698cd9d82e3ca8f7428f7a47d49fe60.tar.bz2 |
tests: Fix some tests when certain features are disabled
namespace, ssl
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | tests/coverage.test | 12 | ||||
-rw-r--r-- | tests/expect.tcl | 6 | ||||
-rw-r--r-- | tests/ssl.test | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/coverage.test b/tests/coverage.test index 0ef3ef3..faa1f02 100644 --- a/tests/coverage.test +++ b/tests/coverage.test @@ -2,7 +2,7 @@ source [file dirname [info script]]/testing.tcl -testCmdConstraints ref rand +testCmdConstraints ref rand namespace testConstraint debug-invstr 0 catch { @@ -28,7 +28,7 @@ test dupobj-2 {duplicate expr object} { set y } {abc + 1} -test dupobj-3 {duplicate interpolated object} { +test dupobj-3 {duplicate interpolated object} namespace { set w 4 set y def($w) # Now treat it as a namespace object that needs duplicating @@ -36,7 +36,7 @@ test dupobj-3 {duplicate interpolated object} { apply [list x {set x 1} $y] x } {1} -test dupobj-4 {duplicate dict subst object} { +test dupobj-4 {duplicate dict subst object} namespace { # make y a dict subst set def(4) 5 set y def(4) @@ -46,7 +46,7 @@ test dupobj-4 {duplicate dict subst object} { apply [list x {set x 1} $y] x } {1} -test dupobj-5 {duplicate object with no string rep} { +test dupobj-5 {duplicate object with no string rep} namespace { # A sorted list has no string rep set y [lsort {abc def}] # Now treat it as a namespace object that needs duplicating @@ -54,7 +54,7 @@ test dupobj-5 {duplicate object with no string rep} { apply [list x {set x 1} $y] x } {1} -test dupobj-6 {duplicate object with no type dup proc} { +test dupobj-6 {duplicate object with no type dup proc} namespace { set x 6 incr x # x is now an int, an object with no dup proc @@ -65,7 +65,7 @@ test dupobj-6 {duplicate object with no type dup proc} { } } {} -test dupobj-7 {duplicate scan obj} { +test dupobj-7 {duplicate scan obj} namespace { set x "%d %d" scan "1 4" $x y z # Now treat it as a namespace object that needs duplicating diff --git a/tests/expect.tcl b/tests/expect.tcl index e21efc0..f48d460 100644 --- a/tests/expect.tcl +++ b/tests/expect.tcl @@ -26,6 +26,12 @@ # # $p tty ?...? # $p kill ?SIGNAL? +if {![exists -command namespace]} { + # Just enough to support [namespace current] + proc namespace {args} { + return "" + } +} proc expect::spawn {cmd} { lassign [socket pty] m s diff --git a/tests/ssl.test b/tests/ssl.test index 2e23519..4793f95 100644 --- a/tests/ssl.test +++ b/tests/ssl.test @@ -3,7 +3,7 @@ source [file dirname [info script]]/testing.tcl needs constraint jim needs cmd socket needs cmd os.fork -testCmdConstraints load_ssl_certs +needs cmd load_ssl_certs # Note that we don't actually need to load certificates with load_ssl_certs # since the openssl installation should generally automatically load |