905 |
(pass-if "empty string, no char/pred" |
(pass-if "empty string, no char/pred" |
906 |
(zero? (length (string-tokenize "")))) |
(zero? (length (string-tokenize "")))) |
907 |
|
|
|
(pass-if "empty string, char" |
|
|
(zero? (length (string-tokenize "" #\.)))) |
|
|
|
|
908 |
(pass-if "empty string, charset" |
(pass-if "empty string, charset" |
909 |
(zero? (length (string-tokenize "" char-set:punctuation)))) |
(zero? (length (string-tokenize "" char-set:punctuation)))) |
910 |
|
|
911 |
(pass-if "no char/pred" |
(pass-if "no char/pred" |
912 |
(equal? '("foo" "bar" "!a") (string-tokenize "foo\tbar !a"))) |
(equal? '("foo" "bar" "!a") (string-tokenize "foo\tbar !a"))) |
913 |
|
|
|
(pass-if "char" |
|
|
(equal? '("foo:bar" "!a") (string-tokenize "foo:bar.!a" #\.))) |
|
|
|
|
914 |
(pass-if "charset" |
(pass-if "charset" |
915 |
(equal? '("foo" "bar" "a") (string-tokenize "foo:bar.!a" |
(equal? '("foo" "bar" "!a") (string-tokenize "foo\tbar !a" |
916 |
char-set:punctuation))) |
char-set:graphic))) |
|
|
|
|
(pass-if "char, start index" |
|
|
(equal? '("oo:bar" "!a") (string-tokenize "foo:bar.!a" #\. 1))) |
|
917 |
|
|
918 |
(pass-if "charset, start index" |
(pass-if "charset, start index" |
919 |
(equal? '("oo" "bar" "a") (string-tokenize "foo:bar.!a" |
(equal? '("oo" "bar" "!a") (string-tokenize "foo\tbar !a" |
920 |
char-set:punctuation 1))) |
char-set:graphic 1))) |
|
|
|
|
(pass-if "char, start and end index" |
|
|
(equal? '("oo:bar" "!") (string-tokenize "foo:bar.!a" #\. 1 9))) |
|
921 |
|
|
922 |
(pass-if "charset, start and end index" |
(pass-if "charset, start and end index" |
923 |
(equal? '("oo" "bar") (string-tokenize "foo:bar.!a" |
(equal? '("oo" "bar" "!") (string-tokenize "foo\tbar !a" |
924 |
char-set:punctuation 1 9)))) |
char-set:graphic 1 9)))) |
925 |
|
|
926 |
(with-test-prefix "string-filter" |
(with-test-prefix "string-filter" |
927 |
|
|