diff --git a/basis/biassocs/biassocs-tests.factor b/basis/biassocs/biassocs-tests.factor index 2ef54441e1..af10eb18e4 100644 --- a/basis/biassocs/biassocs-tests.factor +++ b/basis/biassocs/biassocs-tests.factor @@ -1,4 +1,4 @@ -USING: biassocs assocs namespaces tools.test ; +USING: biassocs assocs namespaces tools.test hashtables kernel ; IN: biassocs.tests "h" set @@ -30,3 +30,13 @@ H{ { "a" "A" } { "b" "B" } } "a" set [ "A" ] [ "a" "b" get at ] unit-test [ "a" ] [ "A" "b" get value-at ] unit-test + +[ ] [ H{ { 1 2 } } >biassoc "h" set ] unit-test + +[ ] [ "h" get clone "g" set ] unit-test + +[ ] [ 3 4 "g" get set-at ] unit-test + +[ H{ { 1 2 } } ] [ "h" get >hashtable ] unit-test + +[ H{ { 1 2 } { 4 3 } } ] [ "g" get >hashtable ] unit-test diff --git a/basis/biassocs/biassocs.factor b/basis/biassocs/biassocs.factor index 5956589ba5..7daa478f54 100644 --- a/basis/biassocs/biassocs.factor +++ b/basis/biassocs/biassocs.factor @@ -43,4 +43,7 @@ M: biassoc new-assoc INSTANCE: biassoc assoc : >biassoc ( assoc -- biassoc ) - T{ biassoc } assoc-clone-like ; \ No newline at end of file + T{ biassoc } assoc-clone-like ; + +M: biassoc clone + [ from>> ] [ to>> ] bi [ clone ] bi@ biassoc boa ;