RegressionTests__CharacterSetTests.st
author Claus Gittinger <cg@exept.de>
Sat, 01 Mar 2014 14:53:41 +0100
changeset 1053 fad6ec16a95c
parent 574 f868308bfcc1
child 1253 11c17f3bb3c0
permissions -rw-r--r--
category
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
574
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'exept:regression' }"
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ NameSpace: RegressionTests }"
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
TestCase subclass:#CharacterSetTests
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:''
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
1053
fad6ec16a95c category
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
     9
	category:'tests-Regression-Collections'
574
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!CharacterSetTests methodsFor:'tests'!
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
test01_creation
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    |s|
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
    s := CharacterSet new.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
    self assert:(s isEmpty).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
    self assert:(s size == 0).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
    self assert:(s notEmpty) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
    "Created: / 28-01-2011 / 17:32:20 / cg"
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
test02_addRemove
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
    |s|
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
    s := CharacterSet new.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
    self assert:(s size == 0).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
    self assert:(s includes:(Character value:10)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    self assert:(s includes:(Character value:9)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
    self assert:(s includes:(Character value:11)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
    s add:(Character value:10).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    self assert:(s size == 1).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
    self assert:(s includes:(Character value:10)).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    self assert:(s includes:(Character value:9)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    self assert:(s includes:(Character value:11)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    s remove:(Character value:11) ifAbsent:[].
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    self assert:(s size == 1).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    self assert:(s includes:(Character value:10)).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    self assert:(s includes:(Character value:9)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    self assert:(s includes:(Character value:11)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    s remove:(Character value:10).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    self assert:(s size == 0).
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    self assert:(s includes:(Character value:10)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    self assert:(s includes:(Character value:9)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    self assert:(s includes:(Character value:11)) not.
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    "Created: / 28-01-2011 / 17:41:18 / cg"
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!CharacterSetTests class methodsFor:'documentation'!
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
version_CVS
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    ^ '$Header$'
f868308bfcc1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
! !
1053
fad6ec16a95c category
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    61