author | sr |
Tue, 03 Dec 2019 11:47:02 +0100 | |
changeset 766 | 9fbada22f0db |
parent 591 | 4fb069caf7a8 |
child 664 | e31b2e7b658d |
permissions | -rw-r--r-- |
236 | 1 |
"{ Package: 'stx:goodies/sunit' }"! |
220 | 2 |
|
3 |
!Behavior methodsFor:'Camp Smalltalk'! |
|
4 |
||
5 |
sunitSelectors |
|
222 | 6 |
|
7 |
^self selectors |
|
8 |
||
9 |
"Modified: / 11-09-2010 / 15:07:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10 |
! ! |
|
236 | 11 |
|
222 | 12 |
!Block methodsFor:'Camp Smalltalk'! |
13 |
||
14 |
sunitEnsure: aBlock |
|
15 |
||
16 |
^self ensure: aBlock |
|
17 |
! ! |
|
236 | 18 |
|
222 | 19 |
!Block methodsFor:'Camp Smalltalk'! |
20 |
||
21 |
sunitOn: aSignal do: anExceptionBlock |
|
22 |
||
23 |
^self on: aSignal do: anExceptionBlock |
|
24 |
! ! |
|
220 | 25 |
|
244 | 26 |
!Class methodsFor:'Camp Smalltalk'! |
27 |
||
28 |
sunitName |
|
29 |
||
30 |
^self name |
|
31 |
! ! |
|
32 |
||
302
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
33 |
!GenericException methodsFor:'Camp Smalltalk'! |
222 | 34 |
|
35 |
sunitAnnounce: aTestCase toResult: aTestResult |
|
302
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
36 |
aTestResult addError: aTestCase detail: self. |
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
37 |
self sunitExitWith: false. |
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
38 |
|
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
39 |
"Modified: / 03-08-2011 / 13:53:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
220 | 40 |
! ! |
236 | 41 |
|
302
37b0e011624d
TestResult refactoring - now it allow for more fine-grained customization
vrany
parents:
244
diff
changeset
|
42 |
!GenericException methodsFor:'Camp Smalltalk'! |
222 | 43 |
|
44 |
sunitExitWith: aValue |
|
45 |
||
46 |
^self return: aValue |
|
47 |
! ! |
|
236 | 48 |
|
49 |
!GenericException class methodsFor:'Camp Smalltalk'! |
|
50 |
||
51 |
sunitSignalWith: aString |
|
52 |
||
53 |
<resource: #skipInDebuggersWalkBack> |
|
54 |
||
55 |
^self raiseSignal: aString |
|
56 |
||
57 |
"Modified: / 05-12-2009 / 18:29:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
58 |
! ! |
|
59 |
||
222 | 60 |
!Object methodsFor:'Camp Smalltalk'! |
61 |
||
62 |
sunitAddDependent: anObject |
|
63 |
||
64 |
self addDependent: anObject |
|
65 |
! ! |
|
236 | 66 |
|
222 | 67 |
!Object methodsFor:'Camp Smalltalk'! |
68 |
||
69 |
sunitChanged: aspect |
|
70 |
||
71 |
self changed: aspect |
|
72 |
! ! |
|
236 | 73 |
|
222 | 74 |
!Object methodsFor:'Camp Smalltalk'! |
220 | 75 |
|
222 | 76 |
sunitRemoveDependent: anObject |
77 |
||
78 |
self removeDependent: anObject |
|
79 |
! ! |
|
236 | 80 |
|
222 | 81 |
!String methodsFor:'Camp Smalltalk'! |
82 |
||
83 |
sunitAsSymbol |
|
84 |
||
85 |
^self asSymbol |
|
86 |
! ! |
|
236 | 87 |
|
222 | 88 |
!String methodsFor:'Camp Smalltalk'! |
89 |
||
90 |
sunitMatch: aString |
|
91 |
||
92 |
^self match: aString |
|
93 |
! ! |
|
236 | 94 |
|
222 | 95 |
!String methodsFor:'deprecated'! |
96 |
||
97 |
sunitSubStrings |
|
220 | 98 |
|
222 | 99 |
<resource: #obsolete> |
100 |
||
101 |
| stream answer index | |
|
102 |
answer := OrderedCollection new. |
|
103 |
stream := ReadStream on: self. |
|
104 |
[stream atEnd] |
|
105 |
whileFalse: |
|
106 |
[[stream atEnd ifTrue: [^answer asArray]. |
|
107 |
stream peek > Character space] whileFalse: [stream next]. |
|
108 |
index := stream position + 1. |
|
109 |
[stream atEnd or: [stream peek <= Character space]] whileFalse: [stream next]. |
|
110 |
answer |
|
111 |
add: |
|
112 |
(self |
|
113 |
copyFrom: index |
|
114 |
to: stream position)]. |
|
115 |
^answer asArray |
|
116 |
||
117 |
"Modified: / 11-09-2010 / 15:14:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! ! |
|
236 | 119 |
|
222 | 120 |
!Symbol methodsFor:'Camp Smalltalk'! |
121 |
||
122 |
sunitAsClass |
|
591 | 123 |
"this is an sunit compatibility wrapper: return the class by that name" |
124 |
||
125 |
^SUnitNameResolver classNamed: self |
|
222 | 126 |
! ! |
127 |
||
236 | 128 |
!stx_goodies_sunit class methodsFor:'documentation'! |
222 | 129 |
|
236 | 130 |
extensionsVersion_CVS |
591 | 131 |
^ '$Header: /cvs/stx/stx/goodies/sunit/extensions.st,v 1.17 2014-07-09 16:22:02 cg Exp $' |
132 |
! ! |
|
133 |