diff options
author | antirez <antirez> | 2005-03-29 16:50:22 +0000 |
---|---|---|
committer | antirez <antirez> | 2005-03-29 16:50:22 +0000 |
commit | 15dc45ec7c7c6f9e31300b6c025f46d8adec16d8 (patch) | |
tree | 47a64fc12e95e714d822b4c9b0bfa7c5e1d8a150 /test.tcl | |
parent | b0e3d498bf73bfebe7d1fe92e39518fe8c66e936 (diff) | |
download | jimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.zip jimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.tar.gz jimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.tar.bz2 |
[info args] added
Diffstat (limited to 'test.tcl')
-rw-r--r-- | test.tcl | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -1,4 +1,4 @@ -# $Id: test.tcl,v 1.28 2005/03/28 17:47:15 antirez Exp $ +# $Id: test.tcl,v 1.29 2005/03/29 16:50:22 antirez Exp $ # # This are Tcl tests imported into Jim. Tests that will probably not be passed # in the long term are usually removed (for example all the tests about @@ -4194,6 +4194,28 @@ catch {unset x} catch {unset y} ################################################################################ +# RAND +################################################################################ +test rand-1.0 {Only one output is valid} { + list [rand 100 100] [rand 101 101] +} {100 101} + +test rand-1.1 {invalid arguments} { + catch {rand 100 50} err + set err +} {Invalid arguments (max < min)} + +test rand-1.2 {Check limits} { + set sum 0 + for {set i 0} {$i < 100} {incr i} { + incr sum [expr {([rand $i] >= 0)+([rand $i] < 100)}] + } + set sum +} {200} + +catch {unset sum; unset err; unset i} + +################################################################################ # JIM REGRESSION TESTS ################################################################################ test regression-1.0 {Rename against procedures with static vars} { |