author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 26 Nov 2017 20:40:34 +0000 | |
branch | jv |
changeset 696 | 268bf2c60556 |
parent 664 | e31b2e7b658d |
child 724 | 4dae63fce9f9 |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
4 |
|
0 | 5 |
TestCase subclass:#ExampleSetTest |
6 |
instanceVariableNames:'full empty' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
9 |
category:'SUnit-Tests' |
0 | 10 |
! |
11 |
||
9 | 12 |
|
68 | 13 |
!ExampleSetTest methodsFor:'running'! |
0 | 14 |
|
15 |
setUp |
|
16 |
empty := Set new. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
17 |
full := Set with: 5 with: #abc |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
18 |
! ! |
0 | 19 |
|
68 | 20 |
!ExampleSetTest methodsFor:'testing'! |
0 | 21 |
|
22 |
testAdd |
|
23 |
empty add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
24 |
self assert: (empty includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
25 |
! |
0 | 26 |
|
27 |
testGrow |
|
28 |
empty addAll: (1 to: 100). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
29 |
self assert: empty size = 100 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
30 |
! |
0 | 31 |
|
32 |
testIllegal |
|
222 | 33 |
self |
34 |
should: [empty at: 5] |
|
0 | 35 |
raise: TestResult error. |
222 | 36 |
self |
37 |
should: [empty at: 5 put: #abc] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
38 |
raise: TestResult error |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
39 |
! |
0 | 40 |
|
41 |
testIncludes |
|
42 |
self assert: (full includes: 5). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
43 |
self assert: (full includes: #abc) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
44 |
! |
0 | 45 |
|
46 |
testOccurrences |
|
47 |
self assert: (empty occurrencesOf: 0) = 0. |
|
48 |
self assert: (full occurrencesOf: 5) = 1. |
|
49 |
full add: 5. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
50 |
self assert: (full occurrencesOf: 5) = 1 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
51 |
! |
0 | 52 |
|
53 |
testRemove |
|
54 |
full remove: 5. |
|
55 |
self assert: (full includes: #abc). |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
56 |
self deny: (full includes: 5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
57 |
! ! |
0 | 58 |
|
14 | 59 |
!ExampleSetTest class methodsFor:'documentation'! |
60 |
||
222 | 61 |
version_SVN |
62 |
^ '§Id: ExampleSetTest.st 214 2011-03-14 12:22:21Z vranyj1 §' |
|
14 | 63 |
! ! |
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
64 |