1 ! Copyright (C) 2008, 2009 Daniel Ehrenberg.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: unicode tools.test namespaces strings unicode.case
6 ! FIXME: Unicode 12.1.0 capitalizes the M in I'M too on purpose
8 ! { "Hello How Are You? I’m Good" }
9 ! [ "hEllo how ARE yOU? I’m good" >title ] unit-test
11 { "Hello How Are You?" }
12 [ "hEllo how ARE yOU?" >title ] unit-test
15 { "FUSS" } [ "Fu\u0000DF" >upper ] unit-test
17 { "\u0003C3a\u0003C2 \u0003C3\u0003C2 \u0003C3a\u0003C2" }
18 [ "\u0003A3A\u0003A3 \u0003A3\u0003A3 \u0003A3A\u0003A3" >lower ] unit-test
21 [ "hello how are you?" lower? ] unit-test
24 { f } [ locale get i-dot? ] unit-test
25 { f } [ locale get lithuanian? ] unit-test
27 { t } [ locale get i-dot? ] unit-test
28 { f } [ locale get lithuanian? ] unit-test
29 { "i\u000131i \u000131jj" } [ "i\u000131I\u000307 IJj" >lower ] unit-test
30 { "I\u000307\u000131i Ijj" } [ "i\u000131I\u000307 IJj" >title ] unit-test
31 { "I\u000307II\u000307 IJJ" } [ "i\u000131I\u000307 IJj" >upper ] unit-test
33 { f } [ locale get i-dot? ] unit-test
34 { t } [ locale get lithuanian? ] unit-test
35 { "i\u000307\u000300" } [ 0xCC 1string nfd >lower ] unit-test
36 { "\u00012f\u000307" } [ 0x12E 1string nfd >lower nfc ] unit-test
37 { "I\u000300" } [ "i\u000307\u000300" >upper ] unit-test
38 ! [ "I\u000300" ] [ "i\u000307\u000300" >title ] unit-test
41 { t } [ "asdf" lower? ] unit-test
42 { f } [ "asdF" lower? ] unit-test
44 { t } [ "ASDF" upper? ] unit-test
45 { f } [ "ASDf" upper? ] unit-test