]> gitweb.factorcode.org Git - factor.git/blobdiff - core/hashtables/hashtables-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / core / hashtables / hashtables-tests.factor
index a59c6495983b9bdde080ea63452af2e1070d5bba..54e58c0282729653e990cf8052d7fab3c3bcd66f 100644 (file)
@@ -1,7 +1,7 @@
-IN: hashtables.tests
 USING: kernel math namespaces make tools.test vectors sequences
 sequences.private hashtables io prettyprint assocs
 continuations ;
+IN: hashtables.tests
 
 [ f ] [ "hi" V{ 1 2 3 } at ] unit-test
 
@@ -134,7 +134,7 @@ H{ } "x" set
 
 [ H{ { -1 4 } { -3 16 } { -5 36 } } ] [
     H{ { 1 2 } { 3 4 } { 5 6 } }
-    [ >r neg r> sq ] assoc-map
+    [ [ neg ] dip sq ] assoc-map
 ] unit-test
 
 ! Bug discovered by littledan
@@ -176,3 +176,6 @@ H{ } "x" set
 [ 1 ] [ "h" get assoc-size ] unit-test
 
 [ 1 ] [ 2 "h" get at ] unit-test
+
+! Random test case
+[ "A" ] [ 100 [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 swap at ] unit-test