hashtables: testing that associate and H{ } set-at have same characteristics.

db4
John Benediktsson 2012-08-03 08:30:55 -07:00
parent a1682451eb
commit 4a56b0c178
1 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
USING: kernel math namespaces make tools.test vectors sequences
sequences.private hashtables io prettyprint assocs
continuations ;
USING: accessors assocs continuations hashtables io kernel make
math namespaces prettyprint sequences sequences.private
tools.test vectors ;
IN: hashtables.tests
[ H{ } ] [ { } [ dup ] H{ } map>assoc ] unit-test
@ -19,6 +19,12 @@ unit-test
[ { 1 { 2 3 } } hashtable? ]
unit-test
{ t } [
"value" "key"
[ associate ] [ H{ } clone [ set-at ] keep ] 2bi
[ = ] [ [ array>> length ] bi@ = ] 2bi and
] unit-test
! Test some hashcodes.
[ t ] [ [ 1 2 3 ] hashcode [ 1 2 3 ] hashcode = ] unit-test