]> gitweb.factorcode.org Git - factor.git/blobdiff - core/hashtables/hashtables-tests.factor
stomp.cli: simplify
[factor.git] / core / hashtables / hashtables-tests.factor
index 63c7c506ac3cebc666683155750ad2be2f730b62..96ae5f71a949d1aec30c55842244d4617b801854 100644 (file)
@@ -1,13 +1,12 @@
-USING: accessors assocs continuations fry hashtables kernel make
-math namespaces sequences slots.private tools.test ;
-IN: hashtables.tests
+USING: accessors assocs continuations hashtables kernel make
+math namespaces sequences tools.test ;
 
 { H{ } } [ { } [ dup ] H{ } map>assoc ] unit-test
 
-{ } [ 1000 iota [ dup sq ] H{ } map>assoc "testhash" set ] unit-test
+{ } [ 1000 <iota> [ dup sq ] H{ } map>assoc "testhash" set ] unit-test
 
 { V{ } }
-[ 1000 iota [ dup sq swap "testhash" get at = ] reject ]
+[ 1000 <iota> [ dup sq swap "testhash" get at = ] reject ]
 unit-test
 
 { t }
@@ -142,7 +141,7 @@ H{ } "x" set
 
 ! make sure growth and capacity use same load-factor
 { t } [
-    100 iota
+    100 <iota>
     [ [ <hashtable> ] map ]
     [ [ H{ } clone [ '[ dup _ set-at ] each-integer ] keep ] map ] bi
     [ [ array>> length ] bi@ = ] 2all?
@@ -184,17 +183,4 @@ H{ } "x" set
 { 1 } [ 2 "h" get at ] unit-test
 
 ! Random test case
-{ "A" } [ 100 iota [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 of ] unit-test
-
-! Bug 1392, word's hashcode was declared a fixnum
-! It fails depending on hash growth, so test in a loop
-SYMBOL: +bignum-hashcode+
--405534154 +bignum-hashcode+ 1 set-slot
-{ t } [
-    100 iota [
-        drop
-        H{ } clone
-        f +bignum-hashcode+ pick set-at
-        +bignum-hashcode+ +bignum-hashcode+ pick set-at assoc-size 1 =
-    ] all?
-] unit-test
+{ "A" } [ 100 <iota> [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 of ] unit-test