1 USING: splitting tools.test kernel sequences arrays ;
4 [ "hello" "world ." ] [ "hello world ." " " split1 ] unit-test
5 [ "hello" "world-+." ] [ "hello-+world-+." "-+" split1 ] unit-test
6 [ "goodbye" f ] [ "goodbye" " " split1 ] unit-test
7 [ "" "" ] [ "great" "great" split1 ] unit-test
9 [ "hello world" "." ] [ "hello world ." " " last-split1 ] unit-test
10 [ "hello-+world" "." ] [ "hello-+world-+." "-+" last-split1 ] unit-test
11 [ "goodbye" f ] [ "goodbye" " " last-split1 ] unit-test
12 [ "" "" ] [ "great" "great" last-split1 ] unit-test
14 [ "and end" t ] [ "Beginning and end" "Beginning " ?head ] unit-test
15 [ "Beginning and end" f ] [ "Beginning and end" "Beginning x" ?head ] unit-test
16 [ "Beginning and end" f ] [ "Beginning and end" "eginning " ?head ] unit-test
18 [ "Beginning" t ] [ "Beginning and end" " and end" ?tail ] unit-test
19 [ "Beginning and end" f ] [ "Beginning and end" "Beginning x" ?tail ] unit-test
20 [ "Beginning and end" f ] [ "Beginning and end" "eginning " ?tail ] unit-test
22 [ { "This" "is" "a" "split" "sentence" } ]
23 [ "This is a split sentence" " " split ]
27 [ "OneWord" " " split ]
30 [ { "a" "b" "c" "d" "e" "f" } ]
31 [ "aXbYcXdYeXf" "XY" split ] unit-test
34 [ " " " " split ] unit-test
37 [ "hey" " " split ] unit-test
39 [ "Hello world" t ] [ "Hello world\n" "\n" ?tail ] unit-test
40 [ "Hello world" f ] [ "Hello world" "\n" ?tail ] unit-test
41 [ "" t ] [ "\n" "\n" ?tail ] unit-test
42 [ "" f ] [ "" "\n" ?tail ] unit-test
44 [ { "" } ] [ "" string-lines ] unit-test
45 [ { "" "" } ] [ "\n" string-lines ] unit-test
46 [ { "" "" } ] [ "\r" string-lines ] unit-test
47 [ { "" "" } ] [ "\r\n" string-lines ] unit-test
48 [ { "hello" } ] [ "hello" string-lines ] unit-test
49 [ { "hello" "" } ] [ "hello\n" string-lines ] unit-test
50 [ { "hello" "" } ] [ "hello\r" string-lines ] unit-test
51 [ { "hello" "" } ] [ "hello\r\n" string-lines ] unit-test
52 [ { "hello" "hi" } ] [ "hello\nhi" string-lines ] unit-test
53 [ { "hello" "hi" } ] [ "hello\rhi" string-lines ] unit-test
54 [ { "hello" "hi" } ] [ "hello\r\nhi" string-lines ] unit-test