]> gitweb.factorcode.org Git - factor.git/blobdiff - library/test/hashtables.factor
working on the test suite
[factor.git] / library / test / hashtables.factor
index 295688cc0b098b80399a23c953c7152e99e8ca85..d1ea6fe5a101cdb4d3c7a4845766327cb1d06af1 100644 (file)
@@ -1,41 +1,28 @@
 IN: scratchpad
 USE: arithmetic
-USE: combinators
-USE: compiler
 USE: hashtables
 USE: kernel
 USE: lists
 USE: logic
 USE: namespaces
 USE: stack
-USE: stdio
-USE: strings
 USE: test
-
-"Checking hashtables" print
+USE: vectors
 
 16 <hashtable> "testhash" set
 
-: silly-key/value dup sq swap ;
+: silly-key/value dup dup * swap ;
 
 1000 [ silly-key/value "testhash" get set-hash ] times*
 
 [ f ]
-[ 1000 count ]
-[ [ silly-key/value "testhash" get hash = not ] subset ]
-test-word
+[ 1000 count [ silly-key/value "testhash" get hash = not ] subset ]
+unit-test
 
 [ t ]
-[ "testhash" get ]
-[ hashtable? ]
-test-word
-
-[ f ]
-[ [ 1 2 | 3 ] ]
-[ hashtable? ]
-test-word
+[ "testhash" get hashtable? ]
+unit-test
 
 [ f ]
-[ namestack* ]
-[ hashtable? ]
-test-word
+[ [ 1 2 | 3 ] hashtable? ]
+unit-test