]> gitweb.factorcode.org Git - factor.git/blob - basis/unicode/case/case-tests.factor
use radix literals
[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.case tools.test namespaces strings unicode.normalize
4 unicode.case.private ;
5 IN: unicode.case.tests
6
7 [ "Hello How Are You? I'm Good" ] [ "hEllo how ARE yOU? I'm good" >title ] unit-test
8 [ "FUSS" ] [ "Fu\u0000DF" >upper ] unit-test
9 [ "\u0003C3a\u0003C2 \u0003C3\u0003C2 \u0003C3a\u0003C2" ] [ "\u0003A3A\u0003A3 \u0003A3\u0003A3 \u0003A3A\u0003A3" >lower ] unit-test
10 [ t ] [ "hello how are you?" lower? ] unit-test
11 [
12     [ f ] [ i-dot? ] unit-test
13     [ f ] [ lithuanian? ] unit-test
14     "tr" locale set
15     [ t ] [ i-dot? ] unit-test
16     [ f ] [ lithuanian? ] unit-test
17     [ "i\u000131i \u000131jj" ] [ "i\u000131I\u000307 IJj" >lower ] unit-test
18     [ "I\u000307\u000131i Ijj" ] [ "i\u000131I\u000307 IJj" >title ] unit-test
19     [ "I\u000307II\u000307 IJJ" ] [ "i\u000131I\u000307 IJj" >upper ] unit-test
20     "lt" locale set
21     [ f ] [ i-dot? ] unit-test
22     [ t ] [ lithuanian? ] unit-test
23     [ "i\u000307\u000300" ] [ 0xCC 1string nfd >lower ] unit-test
24     [ "\u00012f\u000307" ] [ 0x12E 1string nfd >lower nfc ] unit-test
25     [ "I\u000300" ] [ "i\u000307\u000300" >upper ] unit-test
26 !    [ "I\u000300" ] [ "i\u000307\u000300" >title ] unit-test
27 ] with-scope
28
29 [ t ] [ "asdf" lower? ] unit-test
30 [ f ] [ "asdF" lower? ] unit-test
31
32 [ t ] [ "ASDF" upper? ] unit-test
33 [ f ] [ "ASDf" upper? ] unit-test