]> gitweb.factorcode.org Git - factor.git/blob - basis/unicode/case/case-tests.factor
unicode: Update to 11.0
[factor.git] / basis / unicode / case / case-tests.factor
1 ! Copyright (C) 2008, 2009 Daniel Ehrenberg.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: unicode tools.test namespaces strings unicode.case
4 unicode.case.private ;
5
6 { "Hello How Are You? I’m Good" } [ "hEllo how ARE yOU? I’m good" >title ] unit-test
7 { "FUSS" } [ "Fu\u0000DF" >upper ] unit-test
8 { "\u0003C3a\u0003C2 \u0003C3\u0003C2 \u0003C3a\u0003C2" } [ "\u0003A3A\u0003A3 \u0003A3\u0003A3 \u0003A3A\u0003A3" >lower ] unit-test
9 { t } [ "hello how are you?" lower? ] unit-test
10 [
11     { f } [ locale get i-dot? ] unit-test
12     { f } [ locale get lithuanian? ] unit-test
13     "tr" locale set
14     { t } [ locale get i-dot? ] unit-test
15     { f } [ locale get lithuanian? ] unit-test
16     { "i\u000131i \u000131jj" } [ "i\u000131I\u000307 IJj" >lower ] unit-test
17     { "I\u000307\u000131i Ijj" } [ "i\u000131I\u000307 IJj" >title ] unit-test
18     { "I\u000307II\u000307 IJJ" } [ "i\u000131I\u000307 IJj" >upper ] unit-test
19     "lt" locale set
20     { f } [ locale get i-dot? ] unit-test
21     { t } [ locale get lithuanian? ] unit-test
22     { "i\u000307\u000300" } [ 0xCC 1string nfd >lower ] unit-test
23     { "\u00012f\u000307" } [ 0x12E 1string nfd >lower nfc ] unit-test
24     { "I\u000300" } [ "i\u000307\u000300" >upper ] unit-test
25 !    [ "I\u000300" ] [ "i\u000307\u000300" >title ] unit-test
26 ] with-scope
27
28 { t } [ "asdf" lower? ] unit-test
29 { f } [ "asdF" lower? ] unit-test
30
31 { t } [ "ASDF" upper? ] unit-test
32 { f } [ "ASDf" upper? ] unit-test