1 ! Copyright (C) 2008 Marc Fauconneau.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test suffix-arrays kernel namespaces sequences ;
4 IN: suffix-arrays.tests
6 ! built from [ all-words 10 head [ name>> ] map ]
19 } >suffix-array "suffix-array" set
23 [ "suffix-array" get "" swap query empty? not ] unit-test
26 [ SA{ } "something" swap query ] unit-test
28 [ V{ "unit-test" "(unit-test)" } ]
29 [ "suffix-array" get "unit-test" swap query ] unit-test
32 [ "suffix-array" get "something else" swap query empty? ] unit-test
34 [ V{ "rofl" } ] [ SA{ "rofl" } "r" swap query ] unit-test
35 [ V{ "rofl" } ] [ SA{ "rofl" } "o" swap query ] unit-test
36 [ V{ "rofl" } ] [ SA{ "rofl" } "f" swap query ] unit-test
37 [ V{ "rofl" } ] [ SA{ "rofl" } "l" swap query ] unit-test
38 [ V{ } ] [ SA{ "rofl" } "t" swap query ] unit-test