1 USING: tools.test state-parser kernel io strings ascii ;
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