]> gitweb.factorcode.org Git - factor.git/blob - basis/hash2/hash2-tests.factor
Fix conflict in images vocab
[factor.git] / basis / hash2 / hash2-tests.factor
1 USING: tools.test hash2 kernel ;
2 IN: hash2.tests
3
4 [ t ] [ 1 2 { 1 2 } 2= ] unit-test
5 [ f ] [ 1 3 { 1 2 } 2= ] unit-test
6
7 : sample-hash
8     5 <hash2>
9     dup 2 3 "foo" roll set-hash2
10     dup 4 2 "bar" roll set-hash2
11     dup 4 7 "other" roll set-hash2 ;
12
13 [ "foo" ] [ 2 3 sample-hash hash2 ] unit-test
14 [ "bar" ] [ 4 2 sample-hash hash2 ] unit-test
15 [ "other" ] [ 4 7 sample-hash hash2 ] unit-test
16 [ f ] [ 4 12 sample-hash hash2 ] unit-test
17 [ f ] [ 1 1 sample-hash hash2 ] unit-test