1 ! Copyright (C) 2010 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs hashtables.identity kernel literals tools.test ;
4 IN: hashtables.identity.tests
6 CONSTANT: the-real-slim-shady "marshall mathers"
10 { $ the-real-slim-shady t }
11 { "marshall mathers" f }
14 : please-stand-up ( assoc key -- value )
17 { t } [ will the-real-slim-shady please-stand-up ] unit-test
18 { t } [ will clone the-real-slim-shady please-stand-up ] unit-test
20 { 2 } [ will assoc-size ] unit-test
21 { { { "marshall mathers" f } } } [
22 the-real-slim-shady will clone
23 [ delete-at ] [ >alist ] bi
26 t the-real-slim-shady identity-associate
27 t the-real-slim-shady identity-associate =
30 t the-real-slim-shady identity-associate
31 t "marshall mathers" identity-associate =
34 CONSTANT: same-as-it-ever-was "same as it ever was"
36 { IH{ { $ same-as-it-ever-was $ same-as-it-ever-was } } }
37 [ H{ { $ same-as-it-ever-was $ same-as-it-ever-was } } IH{ } assoc-like ] unit-test