aboutsummaryrefslogtreecommitdiff
path: root/test.tcl
diff options
context:
space:
mode:
authorantirez <antirez>2005-03-29 16:50:22 +0000
committerantirez <antirez>2005-03-29 16:50:22 +0000
commit15dc45ec7c7c6f9e31300b6c025f46d8adec16d8 (patch)
tree47a64fc12e95e714d822b4c9b0bfa7c5e1d8a150 /test.tcl
parentb0e3d498bf73bfebe7d1fe92e39518fe8c66e936 (diff)
downloadjimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.zip
jimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.tar.gz
jimtcl-15dc45ec7c7c6f9e31300b6c025f46d8adec16d8.tar.bz2
[info args] added
Diffstat (limited to 'test.tcl')
-rw-r--r--test.tcl24
1 files changed, 23 insertions, 1 deletions
diff --git a/test.tcl b/test.tcl
index ccd7858..4f0e433 100644
--- a/test.tcl
+++ b/test.tcl
@@ -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} {