From 4a56b0c17892d8a2ab9fdf286a0d540548153ec1 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 3 Aug 2012 08:30:55 -0700 Subject: [PATCH] hashtables: testing that associate and H{ } set-at have same characteristics. --- core/hashtables/hashtables-tests.factor | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/hashtables/hashtables-tests.factor b/core/hashtables/hashtables-tests.factor index 541f98ab9c..40ccfc4e9a 100644 --- a/core/hashtables/hashtables-tests.factor +++ b/core/hashtables/hashtables-tests.factor @@ -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