Skip to content

Commit

Permalink
unicode: version the test files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Dec 5, 2023
1 parent bf2aec0 commit ca5e87f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions basis/unicode/breaks/breaks-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ IN: unicode.breaks.tests
{ { t f t t f t } } [ 6 <iota> [ "as df" word-break-at? ] map ] unit-test

: grapheme-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/auxiliary/GraphemeBreakTest.txt"
"GraphemeBreakTest.txt" cache-file [ ?download-to ] keep ;
"https://downloads.factorcode.org/misc/UCD/15.0.0/auxiliary/GraphemeBreakTest.txt"
"GraphemeBreakTest-15.0.0.txt" cache-file [ ?download-to ] keep ;

: word-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/auxiliary/WordBreakTest.txt"
"WordBreakTest.txt" cache-file [ ?download-to ] keep ;
"https://downloads.factorcode.org/misc/UCD/15.0.0/auxiliary/WordBreakTest.txt"
"WordBreakTest-15.0.0.txt" cache-file [ ?download-to ] keep ;

: parse-test-file ( file-name -- tests )
utf8 file-lines
Expand Down
4 changes: 2 additions & 2 deletions basis/unicode/collation/collation-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ IN: unicode.collation.tests
[ { "HELLO" "goodbye" "good bye" "hello" } sort-strings ] unit-test

: collation-test-lines ( -- lines )
"https://downloads.factorcode.org/misc/UCA/CollationTest_SHIFTED.txt"
"CollationTest_SHIFTED.txt" cache-file [ ?download-to ] keep
"https://downloads.factorcode.org/misc/UCA/15.0.0/CollationTest_SHIFTED.txt"
"CollationTest_SHIFTED_15.0.0.txt" cache-file [ ?download-to ] keep
utf8 file-lines [ "#" head? ] reject harvest ;

: parse-collation-test-shifted ( -- lines )
Expand Down
4 changes: 2 additions & 2 deletions basis/unicode/normalize/normalize-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ IN: unicode.normalize.tests

! Could use simple-flat-file after some cleanup
: parse-normalization-tests ( -- tests )
"https://downloads.factorcode.org/misc/UCD/NormalizationTest.txt"
"NormalizationTest.txt" cache-file [ ?download-to ] keep
"https://downloads.factorcode.org/misc/UCD/15.0.0/NormalizationTest.txt"
"NormalizationTest-15.0.0.txt" cache-file [ ?download-to ] keep
utf8 file-lines [ "#" head? ] reject
[ "@" head? ] split*-when
2 <groups> [ first2 [ first ] dip 2array ] map
Expand Down

0 comments on commit ca5e87f

Please sign in to comment.