]> gitweb.factorcode.org Git - factor.git/blob - basis/unicode/case/case-tests.factor
Switch to https urls
[factor.git] / basis / unicode / case / case-tests.factor
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
4 unicode.case.private ;
5
6 ! FIXME: Unicode 12.1.0 capitalizes the M in I'M too on purpose
7 ! Look into this
8 ! { "Hello How Are You? I’m Good" }
9 ! [ "hEllo how ARE yOU? I’m good" >title ] unit-test
10
11 { "Hello How Are You?" }
12 [ "hEllo how ARE yOU?" >title ] unit-test
13
14
15 { "FUSS" } [ "Fu\u0000DF" >upper ] unit-test
16
17 { "\u0003C3a\u0003C2 \u0003C3\u0003C2 \u0003C3a\u0003C2" }
18 [ "\u0003A3A\u0003A3 \u0003A3\u0003A3 \u0003A3A\u0003A3" >lower ] unit-test
19
20 { t }
21 [ "hello how are you?" lower? ] unit-test
22
23 [
24     { f } [ locale get i-dot? ] unit-test
25     { f } [ locale get lithuanian? ] unit-test
26     "tr" locale set
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
32     "lt" locale set
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
39 ] with-scope
40
41 { t } [ "asdf" lower? ] unit-test
42 { f } [ "asdF" lower? ] unit-test
43
44 { t } [ "ASDF" upper? ] unit-test
45 { f } [ "ASDf" upper? ] unit-test