1 USING: tools.test unicode.breaks sequences math kernel splitting
2 unicode.categories io.pathnames io.encodings.utf8 io.files
3 strings quotations math.parser ;
4 IN: unicode.breaks.tests
6 [ "\u001112\u001161\u0011abA\u000300a\r\r\n" ]
7 [ "\r\n\raA\u000300\u001112\u001161\u0011ab" string-reverse ] unit-test
8 [ "dcba" ] [ "abcd" string-reverse ] unit-test
9 [ 3 ] [ "\u001112\u001161\u0011abA\u000300a"
10 dup last-grapheme head last-grapheme ] unit-test
12 : grapheme-break-test ( -- filename )
13 "basis/unicode/breaks/GraphemeBreakTest.txt"
16 : parse-test-file ( -- tests )
17 grapheme-break-test utf8 file-lines
18 [ "#" split1 drop ] map harvest [
20 [ "×" split [ [ blank? ] trim hex> ] map harvest >string ] map
24 : test-graphemes ( tests -- )
27 [ concat [ >graphemes [ "" like ] map ] curry ] bi unit-test
30 parse-test-file test-graphemes