]> gitweb.factorcode.org Git - factor.git/blob - basis/state-parser/state-parser-tests.factor
e0b274b3e6e17a682cc0ed1ac3ebb5e56c2a45ee
[factor.git] / basis / state-parser / state-parser-tests.factor
1 USING: tools.test state-parser kernel io strings ascii ;
2
3 [ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test
4 [ 2 4 ] [ "12\n123" [ take-rest drop get-line get-column ] string-parse ] unit-test
5 [ "hi" " how are you?" ] [ "hi how are you?" [ [ get-char blank? ] take-until take-rest ] string-parse ] unit-test
6 [ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test
7 [ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test
8 [ "baz" ] [ " \n\t baz" [ pass-blank take-rest ] string-parse ] unit-test