]> gitweb.factorcode.org Git - factor.git/blobdiff - core/strings/strings-tests.factor
core: subseq-index? -> subseq-of?
[factor.git] / core / strings / strings-tests.factor
index ef071188e9583408e119af58c8e99b1b19ca9340..0fa54fe49e5abf2b08ecd105939e46063ce06597 100644 (file)
@@ -21,13 +21,22 @@ vectors ;
 { f } [ "amigo" "hola" subseq-start ] unit-test
 { f } [ "holaa" "hola" subseq-start ] unit-test
 
+{ 3 } [ "hola" "a" subseq-index ] unit-test
+{ f } [ "hola" "x" subseq-index ] unit-test
+{ 0 } [ "a" "" subseq-index ] unit-test
+{ 0 } [ "" "" subseq-index ] unit-test
+{ 0 } [ "hola" "hola" subseq-index ] unit-test
+{ 1 } [ "hola" "ol" subseq-index ] unit-test
+{ f } [ "hola" "amigo" subseq-index ] unit-test
+{ f } [ "hola" "holaa" subseq-index ] unit-test
+
 { "Beginning" } [ "Beginning and end" 9 head ] unit-test
 
 { f } [ CHAR: I "team" member? ] unit-test
 { t } [ "ea" "team" subseq? ] unit-test
 { f } [ "actore" "Factor" subseq? ] unit-test
-{ t } [ "team" "ea" subsequence? ] unit-test
-{ f } [ "Factor" "actore" subsequence? ] unit-test
+{ t } [ "team" "ea" subseq-of? ] unit-test
+{ f } [ "Factor" "actore" subseq-of? ] unit-test
 
 { "end" } [ "Beginning and end" 14 tail ] unit-test