235
|
1 |
"{ Package: 'exept:regression' }"
|
|
2 |
|
274
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
235
|
5 |
TestCase subclass:#CharacterTests
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Collections-Text-Encodings'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!CharacterTests methodsFor:'tests'!
|
|
14 |
|
|
15 |
test01CaseTesting
|
|
16 |
CharacterEncoderCodeGenerator new
|
274
|
17 |
readingUnicodeDataFrom:
|
|
18 |
"/ '/phys/exept/home/documentation/standards/unicode/UnicodeData-3.1.0.txt'
|
|
19 |
'/phys/exept/home/documentation/standards/unicode/UnicodeData-4.0.0.txt'
|
|
20 |
asFilename readStream
|
|
21 |
do:[:codePoint :name :category :canOrd :bidiCat :decMap
|
|
22 |
:decDigitValue :digitValue :numValue
|
|
23 |
:mirrored :unicodeName :comment :ucValue :lcValue :tcValue |
|
|
24 |
|ch ucCh lcCh tcCh isUppercase isLowercase isTitlecase isLetter dToUc dToLc|
|
235
|
25 |
|
274
|
26 |
isUppercase := category = 'Lu'.
|
|
27 |
isLowercase := category = 'Ll'.
|
|
28 |
isTitlecase := category = 'Lt'.
|
|
29 |
isLetter := isUppercase | isLowercase | isTitlecase
|
|
30 |
or:[(category = 'Lm') or:[(category = 'Lo')]].
|
235
|
31 |
|
274
|
32 |
ch := Character value:codePoint.
|
|
33 |
self assert:(ch isUppercase == isUppercase).
|
|
34 |
self assert:(ch isLowercase == isLowercase).
|
|
35 |
"/ self assert:(ch isTitlecase == isTitlecase).
|
|
36 |
self assert:(ch isNationalLetter == isLetter).
|
235
|
37 |
|
274
|
38 |
ucValue notNil ifTrue:[
|
|
39 |
ucCh := Character value:ucValue.
|
|
40 |
self assert:(ch asUppercase = ucCh).
|
|
41 |
] ifFalse:[
|
|
42 |
self assert:(ch asUppercase = ch).
|
|
43 |
].
|
|
44 |
lcValue notNil ifTrue:[
|
|
45 |
lcCh := Character value:lcValue.
|
|
46 |
self assert:(ch asLowercase = lcCh).
|
|
47 |
] ifFalse:[
|
|
48 |
self assert:(ch asLowercase = ch).
|
|
49 |
].
|
|
50 |
tcValue notNil ifTrue:[
|
|
51 |
tcCh := Character value:tcValue.
|
|
52 |
self assert:(ch asTitlecase = tcCh).
|
|
53 |
] ifFalse:[
|
|
54 |
self assert:(ch asTitlecase = ch).
|
|
55 |
].
|
|
56 |
].
|
235
|
57 |
|
|
58 |
"
|
|
59 |
self new test01CaseTesting
|
|
60 |
"
|
|
61 |
! !
|
|
62 |
|
|
63 |
!CharacterTests class methodsFor:'documentation'!
|
|
64 |
|
|
65 |
version
|
|
66 |
^ '$Header$'
|
|
67 |
! !
|