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 |
SUnitTest subclass:#TestSuitesScriptTest |
6 |
instanceVariableNames:'scripter suite' |
|
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 |
||
14 | 12 |
|
68 | 13 |
!TestSuitesScriptTest methodsFor:'running'! |
0 | 14 |
|
15 |
setUp |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
16 |
scripter := TestSuitesScripter new. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
0
diff
changeset
|
17 |
! ! |
0 | 18 |
|
68 | 19 |
!TestSuitesScriptTest methodsFor:'testing'! |
0 | 20 |
|
21 |
testCompoundScript |
|
222 | 22 |
| allTestCaseClasses superCase subCase | |
23 |
allTestCaseClasses := (scripter run: 'TestSuitesHierarchyScriptTest TestSuitesCompoundScriptTest') tests. |
|
24 |
self assert: allTestCaseClasses size = 2. |
|
25 |
superCase := (allTestCaseClasses at: 1) tests first. |
|
26 |
self assert: superCase class name asSymbol == #TestSuitesHierarchyScriptTest. |
|
27 |
subCase := (allTestCaseClasses at: 2) tests first. |
|
28 |
self assert: subCase class name asSymbol == #TestSuitesCompoundScriptTest. |
|
0 | 29 |
|
30 |
"Modified: / 21.6.2000 / 10:26:48 / Sames" |
|
31 |
! |
|
32 |
||
33 |
testEmbeddedNameCommentScript |
|
34 |
suite := scripter run: ' "This comment contains the name of a SUnitTest Case" TestSuitesScriptTest'. |
|
35 |
self assert: suite tests size = 1 |
|
36 |
||
37 |
"Modified: / 21.6.2000 / 10:27:02 / Sames" |
|
38 |
! |
|
39 |
||
40 |
testEmptyCommentScript |
|
41 |
suite := scripter run: ' " " TestSuitesScriptTest'. |
|
42 |
self assert: suite tests size = 1 |
|
43 |
||
44 |
"Modified: / 21.6.2000 / 10:27:14 / Sames" |
|
45 |
! |
|
46 |
||
47 |
testEmptyHierachyScript |
|
48 |
suite := scripter run: '*'. |
|
49 |
self assert: suite tests isEmpty |
|
50 |
||
51 |
"Modified: / 21.6.2000 / 10:27:24 / Sames" |
|
52 |
! |
|
53 |
||
54 |
testEmptyScript |
|
55 |
suite := scripter run: ''. |
|
56 |
self assert: suite tests isEmpty |
|
57 |
||
58 |
"Modified: / 21.6.2000 / 10:27:39 / Sames" |
|
59 |
! |
|
60 |
||
61 |
testHierachyScript |
|
222 | 62 |
| allTestCaseClasses superCase subCase | |
63 |
suite := scripter run: 'TestSuitesHierarchyScriptTest*'. |
|
64 |
allTestCaseClasses := suite tests. |
|
65 |
self assert: allTestCaseClasses size = 1. |
|
66 |
superCase := (allTestCaseClasses first tests at: 1) tests first. |
|
67 |
self assert: superCase class name asSymbol = #TestSuitesHierarchyScriptTest. |
|
68 |
subCase := (allTestCaseClasses first tests at: 2) tests first. |
|
69 |
self assert: subCase class name asSymbol = #TestSuitesCompoundScriptTest. |
|
0 | 70 |
|
71 |
"Modified: / 21.6.2000 / 10:28:02 / Sames" |
|
72 |
! |
|
73 |
||
74 |
testOpenCommentScript |
|
75 |
suite := scripter run: ' "SUnitTest'. |
|
76 |
self assert: suite tests isEmpty |
|
77 |
||
78 |
"Modified: / 21.6.2000 / 10:28:18 / Sames" |
|
79 |
! |
|
80 |
||
81 |
testSimpleScript |
|
222 | 82 |
| allTestCaseClasses case | |
83 |
suite := scripter run: 'TestSuitesHierarchyScriptTest'. |
|
84 |
allTestCaseClasses := suite tests. |
|
85 |
self assert: allTestCaseClasses size = 1. |
|
86 |
case := (allTestCaseClasses at: 1) tests at: 1. |
|
87 |
self assert: case class name asSymbol = #TestSuitesHierarchyScriptTest. |
|
0 | 88 |
|
89 |
"Modified: / 21.6.2000 / 10:28:35 / Sames" |
|
90 |
! |
|
91 |
||
92 |
testSingleWordCommentScript |
|
93 |
suite := scripter run: ' "SUnitTest" TestSuitesScriptTest'. |
|
94 |
self assert: suite tests size = 1 |
|
95 |
||
96 |
"Modified: / 21.6.2000 / 10:28:47 / Sames" |
|
97 |
! |
|
98 |
||
99 |
testTwoCommentsScript |
|
100 |
suite := scripter run: ' " SUnitTest " " SUnitTest " TestSuitesScriptTest'. |
|
101 |
self assert: suite tests size = 1 |
|
102 |
||
103 |
"Modified: / 21.6.2000 / 10:28:59 / Sames" |
|
104 |
! ! |
|
105 |
||
14 | 106 |
!TestSuitesScriptTest class methodsFor:'documentation'! |
107 |
||
108 |
version |
|
222 | 109 |
^ '$Header: /cvs/stx/stx/goodies/sunit/TestSuitesScriptTest.st,v 1.6 2011-06-29 19:15:49 cg Exp $' |
110 |
! |
|
111 |
||
112 |
version_SVN |
|
113 |
^ '§Id: TestSuitesScriptTest.st 182 2009-12-05 18:12:17Z vranyj1 §' |
|
14 | 114 |
! ! |
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
115 |