USING: unicode.normalize kernel tools.test sequences
-unicode.data io.encodings.utf8 io.files splitting math.parser
-locals math quotations assocs combinators ;
+simple-flat-file io.encodings.utf8 io.files splitting math.parser
+locals math quotations assocs combinators unicode.normalize.private ;
IN: unicode.normalize.tests
[ "ab\u000323\u000302cd" ] [ "ab\u000302" "\u000323cd" string-append ] unit-test
[ "\u00d55c" ] [ "\u001112\u001161\u0011ab" nfc ] unit-test
: parse-test ( -- tests )
- "resource:basis/unicode/normalize/NormalizationTest.txt"
- utf8 file-lines filter-comments
- [ ";" split 5 head [ " " split [ hex> ] "" map-as ] map ] map ;
+ "vocab:unicode/normalize/NormalizationTest.txt" data
+ [ 5 head [ " " split [ hex> ] "" map-as ] map ] map ;
:: assert= ( test spec quot -- )
spec [
[
- [ 1- test nth ] bi@
+ [ 1 - test nth ] bi@
[ 1quotation ] [ quot curry ] bi* unit-test
] with each
] assoc-each ;
[ { { 5 { 1 2 3 4 5 } } } [ nfkd ] assert= ]
} cleave ;
-! parse-test [ run-line ] each
+parse-test [ run-line ] each