resin 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +2 -0
- data/amber/bin/nodecompile.js +3 -3
- data/amber/css/amber.css +47 -23
- data/amber/images/off.amber.png +0 -0
- data/amber/images/offHover.amber.png +0 -0
- data/amber/images/sprite.amber.png +0 -0
- data/amber/images/tinylogo.amber.png +0 -0
- data/amber/js/Benchfib.deploy.js +34 -34
- data/amber/js/Benchfib.js +49 -49
- data/amber/js/Canvas.deploy.js +937 -937
- data/amber/js/Canvas.js +1622 -1622
- data/amber/js/Compiler-Tests.deploy.js +97 -0
- data/amber/js/Compiler-Tests.js +137 -0
- data/amber/js/Compiler.deploy.js +1030 -924
- data/amber/js/Compiler.js +1613 -1467
- data/amber/js/Documentation.deploy.js +417 -417
- data/amber/js/Documentation.js +728 -728
- data/amber/js/Examples.deploy.js +24 -13
- data/amber/js/Examples.js +36 -19
- data/amber/js/IDE.deploy.js +1583 -1527
- data/amber/js/IDE.js +2586 -2510
- data/amber/js/Kernel-Announcements.deploy.js +19 -19
- data/amber/js/Kernel-Announcements.js +28 -28
- data/amber/js/Kernel-Classes.deploy.js +332 -229
- data/amber/js/Kernel-Classes.js +532 -384
- data/amber/js/Kernel-Collections.deploy.js +1516 -1712
- data/amber/js/Kernel-Collections.js +2436 -2712
- data/amber/js/Kernel-Exceptions.deploy.js +85 -62
- data/amber/js/Kernel-Exceptions.js +131 -98
- data/amber/js/Kernel-Methods.deploy.js +326 -378
- data/amber/js/Kernel-Methods.js +473 -525
- data/amber/js/Kernel-Objects.deploy.js +1777 -2428
- data/amber/js/Kernel-Objects.js +2599 -3426
- data/amber/js/Kernel-Tests.deploy.js +871 -772
- data/amber/js/Kernel-Tests.js +1207 -1083
- data/amber/js/Kernel-Transcript.deploy.js +57 -57
- data/amber/js/Kernel-Transcript.js +94 -94
- data/amber/js/SUnit.deploy.js +116 -116
- data/amber/js/SUnit.js +211 -211
- data/amber/js/amber.js +10 -11
- data/amber/js/boot.js +132 -156
- data/amber/js/init.js +2 -2
- data/amber/js/parser.js +2095 -3014
- data/amber/js/parser.pegjs +1 -1
- data/amber/st/Benchfib.st +22 -22
- data/amber/st/Canvas.st +471 -471
- data/amber/st/Compiler-Tests.st +471 -0
- data/amber/st/Compiler.st +858 -794
- data/amber/st/Examples.st +22 -5
- data/amber/st/IDE.st +1326 -1291
- data/amber/st/Kernel-Announcements.st +2 -2
- data/amber/st/Kernel-Classes.st +148 -90
- data/amber/st/Kernel-Collections.st +950 -1061
- data/amber/st/Kernel-Exceptions.st +33 -25
- data/amber/st/Kernel-Methods.st +151 -151
- data/amber/st/Kernel-Objects.st +891 -1036
- data/amber/st/Kernel-Tests.st +622 -544
- data/amber/st/Kernel-Transcript.st +38 -38
- data/amber/st/SUnit.st +53 -53
- metadata +27 -20
data/amber/js/SUnit.js
CHANGED
@@ -1,89 +1,89 @@
|
|
1
1
|
smalltalk.addPackage('SUnit', {});
|
2
2
|
smalltalk.addClass('TestCase', smalltalk.Object, ['testSelector'], 'SUnit');
|
3
3
|
smalltalk.addMethod(
|
4
|
-
|
4
|
+
"_assert_",
|
5
5
|
smalltalk.method({
|
6
|
-
selector:
|
7
|
-
category: '
|
8
|
-
fn: function (
|
6
|
+
selector: "assert:",
|
7
|
+
category: 'testing',
|
8
|
+
fn: function (aBoolean){
|
9
9
|
var self=this;
|
10
|
-
(self[
|
10
|
+
smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
|
11
11
|
return self;},
|
12
|
-
args: ["
|
13
|
-
source:
|
14
|
-
messageSends: [],
|
12
|
+
args: ["aBoolean"],
|
13
|
+
source: "assert: aBoolean\x0a\x09self assert: aBoolean description: 'Assertion failed'",
|
14
|
+
messageSends: ["assert:description:"],
|
15
15
|
referencedClasses: []
|
16
16
|
}),
|
17
17
|
smalltalk.TestCase);
|
18
18
|
|
19
19
|
smalltalk.addMethod(
|
20
|
-
|
20
|
+
"_assert_description_",
|
21
21
|
smalltalk.method({
|
22
|
-
selector:
|
23
|
-
category: '
|
24
|
-
fn: function (){
|
22
|
+
selector: "assert:description:",
|
23
|
+
category: 'testing',
|
24
|
+
fn: function (aBoolean, aString){
|
25
25
|
var self=this;
|
26
|
-
return self[
|
26
|
+
((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
|
27
27
|
return self;},
|
28
|
-
args: [],
|
29
|
-
source:
|
30
|
-
messageSends: [],
|
28
|
+
args: ["aBoolean", "aString"],
|
29
|
+
source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [self signalFailure: aString]",
|
30
|
+
messageSends: ["ifFalse:", "signalFailure:"],
|
31
31
|
referencedClasses: []
|
32
32
|
}),
|
33
33
|
smalltalk.TestCase);
|
34
34
|
|
35
35
|
smalltalk.addMethod(
|
36
|
-
|
36
|
+
"_assert_equals_",
|
37
37
|
smalltalk.method({
|
38
|
-
selector:
|
39
|
-
category: '
|
40
|
-
fn: function (
|
38
|
+
selector: "assert:equals:",
|
39
|
+
category: 'testing',
|
40
|
+
fn: function (expected, actual){
|
41
41
|
var self=this;
|
42
|
-
|
42
|
+
return smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
|
43
43
|
return self;},
|
44
|
-
args: ["
|
45
|
-
source:
|
46
|
-
messageSends: ["
|
47
|
-
referencedClasses: [
|
44
|
+
args: ["expected", "actual"],
|
45
|
+
source: "assert: expected equals: actual\x0a\x09^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString",
|
46
|
+
messageSends: ["assert:description:", "=", ",", "asString"],
|
47
|
+
referencedClasses: []
|
48
48
|
}),
|
49
49
|
smalltalk.TestCase);
|
50
50
|
|
51
51
|
smalltalk.addMethod(
|
52
|
-
|
52
|
+
"_deny_",
|
53
53
|
smalltalk.method({
|
54
|
-
selector:
|
55
|
-
category: '
|
56
|
-
fn: function (){
|
54
|
+
selector: "deny:",
|
55
|
+
category: 'testing',
|
56
|
+
fn: function (aBoolean){
|
57
57
|
var self=this;
|
58
|
-
|
58
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
|
59
59
|
return self;},
|
60
|
-
args: [],
|
61
|
-
source:
|
62
|
-
messageSends: [],
|
60
|
+
args: ["aBoolean"],
|
61
|
+
source: "deny: aBoolean\x0a\x09self assert: aBoolean not",
|
62
|
+
messageSends: ["assert:", "not"],
|
63
63
|
referencedClasses: []
|
64
64
|
}),
|
65
65
|
smalltalk.TestCase);
|
66
66
|
|
67
67
|
smalltalk.addMethod(
|
68
|
-
|
68
|
+
"_performTestFor_",
|
69
69
|
smalltalk.method({
|
70
|
-
selector:
|
70
|
+
selector: "performTestFor:",
|
71
71
|
category: 'running',
|
72
|
-
fn: function (){
|
72
|
+
fn: function (aResult){
|
73
73
|
var self=this;
|
74
|
-
|
74
|
+
smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}), "_on_do_", [(smalltalk.TestFailure || TestFailure), (function(ex){return smalltalk.send(aResult, "_addFailure_", [self]);})]);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return smalltalk.send(aResult, "_addError_", [self]);})]);
|
75
75
|
return self;},
|
76
|
-
args: [],
|
77
|
-
source:
|
78
|
-
messageSends: [],
|
79
|
-
referencedClasses: []
|
76
|
+
args: ["aResult"],
|
77
|
+
source: "performTestFor: aResult\x0a\x09[[self perform: self selector]\x0a\x09\x09on: TestFailure do: [:ex | aResult addFailure: self]]\x0a\x09\x09on: Error do: [:ex | aResult addError: self]",
|
78
|
+
messageSends: ["on:do:", "perform:", "selector", "addFailure:", "addError:"],
|
79
|
+
referencedClasses: ["TestFailure", "Error"]
|
80
80
|
}),
|
81
81
|
smalltalk.TestCase);
|
82
82
|
|
83
83
|
smalltalk.addMethod(
|
84
|
-
|
84
|
+
"_runCaseFor_",
|
85
85
|
smalltalk.method({
|
86
|
-
selector:
|
86
|
+
selector: "runCaseFor:",
|
87
87
|
category: 'running',
|
88
88
|
fn: function (aTestResult){
|
89
89
|
var self=this;
|
@@ -93,220 +93,220 @@ smalltalk.send(self, "_performTestFor_", [aTestResult]);
|
|
93
93
|
smalltalk.send(self, "_tearDown", []);
|
94
94
|
return self;},
|
95
95
|
args: ["aTestResult"],
|
96
|
-
source:
|
96
|
+
source: "runCaseFor: aTestResult\x0a\x09self setUp.\x0a\x09aTestResult increaseRuns.\x0a\x09self performTestFor: aTestResult.\x0a\x09self tearDown",
|
97
97
|
messageSends: ["setUp", "increaseRuns", "performTestFor:", "tearDown"],
|
98
98
|
referencedClasses: []
|
99
99
|
}),
|
100
100
|
smalltalk.TestCase);
|
101
101
|
|
102
102
|
smalltalk.addMethod(
|
103
|
-
|
103
|
+
"_selector",
|
104
104
|
smalltalk.method({
|
105
|
-
selector:
|
106
|
-
category: '
|
107
|
-
fn: function (
|
105
|
+
selector: "selector",
|
106
|
+
category: 'accessing',
|
107
|
+
fn: function (){
|
108
108
|
var self=this;
|
109
|
-
|
109
|
+
return self['@testSelector'];
|
110
110
|
return self;},
|
111
|
-
args: [
|
112
|
-
source:
|
113
|
-
messageSends: [
|
114
|
-
referencedClasses: [
|
111
|
+
args: [],
|
112
|
+
source: "selector\x0a\x09^testSelector",
|
113
|
+
messageSends: [],
|
114
|
+
referencedClasses: []
|
115
115
|
}),
|
116
116
|
smalltalk.TestCase);
|
117
117
|
|
118
118
|
smalltalk.addMethod(
|
119
|
-
|
119
|
+
"_setTestSelector_",
|
120
120
|
smalltalk.method({
|
121
|
-
selector:
|
122
|
-
category: '
|
123
|
-
fn: function (
|
121
|
+
selector: "setTestSelector:",
|
122
|
+
category: 'accessing',
|
123
|
+
fn: function (aSelector){
|
124
124
|
var self=this;
|
125
|
-
|
125
|
+
(self['@testSelector']=aSelector);
|
126
126
|
return self;},
|
127
|
-
args: ["
|
128
|
-
source:
|
129
|
-
messageSends: [
|
127
|
+
args: ["aSelector"],
|
128
|
+
source: "setTestSelector: aSelector\x0a\x09testSelector := aSelector",
|
129
|
+
messageSends: [],
|
130
130
|
referencedClasses: []
|
131
131
|
}),
|
132
132
|
smalltalk.TestCase);
|
133
133
|
|
134
134
|
smalltalk.addMethod(
|
135
|
-
|
135
|
+
"_setUp",
|
136
136
|
smalltalk.method({
|
137
|
-
selector:
|
138
|
-
category: '
|
139
|
-
fn: function (
|
137
|
+
selector: "setUp",
|
138
|
+
category: 'running',
|
139
|
+
fn: function (){
|
140
140
|
var self=this;
|
141
|
-
|
141
|
+
|
142
142
|
return self;},
|
143
|
-
args: [
|
144
|
-
source:
|
145
|
-
messageSends: [
|
143
|
+
args: [],
|
144
|
+
source: "setUp",
|
145
|
+
messageSends: [],
|
146
146
|
referencedClasses: []
|
147
147
|
}),
|
148
148
|
smalltalk.TestCase);
|
149
149
|
|
150
150
|
smalltalk.addMethod(
|
151
|
-
|
151
|
+
"_should_",
|
152
152
|
smalltalk.method({
|
153
|
-
selector:
|
153
|
+
selector: "should:",
|
154
154
|
category: 'testing',
|
155
|
-
fn: function (
|
155
|
+
fn: function (aBlock){
|
156
156
|
var self=this;
|
157
|
-
|
157
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
|
158
158
|
return self;},
|
159
|
-
args: ["
|
160
|
-
source:
|
161
|
-
messageSends: ["assert:
|
159
|
+
args: ["aBlock"],
|
160
|
+
source: "should: aBlock\x0a\x09self assert: aBlock value",
|
161
|
+
messageSends: ["assert:", "value"],
|
162
162
|
referencedClasses: []
|
163
163
|
}),
|
164
164
|
smalltalk.TestCase);
|
165
165
|
|
166
166
|
smalltalk.addMethod(
|
167
|
-
|
167
|
+
"_should_raise_",
|
168
168
|
smalltalk.method({
|
169
|
-
selector:
|
169
|
+
selector: "should:raise:",
|
170
170
|
category: 'testing',
|
171
|
-
fn: function (
|
171
|
+
fn: function (aBlock, anExceptionClass){
|
172
172
|
var self=this;
|
173
|
-
(
|
173
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return false;}), "_on_do_", [anExceptionClass, (function(ex){return true;})])]);
|
174
174
|
return self;},
|
175
|
-
args: ["
|
176
|
-
source:
|
177
|
-
messageSends: ["
|
175
|
+
args: ["aBlock", "anExceptionClass"],
|
176
|
+
source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. false] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | true])",
|
177
|
+
messageSends: ["assert:", "on:do:", "value"],
|
178
178
|
referencedClasses: []
|
179
179
|
}),
|
180
180
|
smalltalk.TestCase);
|
181
181
|
|
182
182
|
smalltalk.addMethod(
|
183
|
-
|
183
|
+
"_signalFailure_",
|
184
184
|
smalltalk.method({
|
185
|
-
selector:
|
186
|
-
category: '
|
187
|
-
fn: function (
|
185
|
+
selector: "signalFailure:",
|
186
|
+
category: 'private',
|
187
|
+
fn: function (aString){
|
188
188
|
var self=this;
|
189
|
-
smalltalk.send(
|
189
|
+
(function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
|
190
190
|
return self;},
|
191
|
-
args: ["
|
192
|
-
source:
|
193
|
-
messageSends: ["
|
194
|
-
referencedClasses: []
|
191
|
+
args: ["aString"],
|
192
|
+
source: "signalFailure: aString\x0a\x09TestFailure new\x0a\x09\x09messageText: aString;\x0a\x09\x09signal",
|
193
|
+
messageSends: ["messageText:", "signal", "new"],
|
194
|
+
referencedClasses: ["TestFailure"]
|
195
195
|
}),
|
196
196
|
smalltalk.TestCase);
|
197
197
|
|
198
198
|
smalltalk.addMethod(
|
199
|
-
|
199
|
+
"_tearDown",
|
200
200
|
smalltalk.method({
|
201
|
-
selector:
|
202
|
-
category: '
|
203
|
-
fn: function (
|
201
|
+
selector: "tearDown",
|
202
|
+
category: 'running',
|
203
|
+
fn: function (){
|
204
204
|
var self=this;
|
205
|
-
|
205
|
+
|
206
206
|
return self;},
|
207
|
-
args: [
|
208
|
-
source:
|
209
|
-
messageSends: [
|
207
|
+
args: [],
|
208
|
+
source: "tearDown",
|
209
|
+
messageSends: [],
|
210
210
|
referencedClasses: []
|
211
211
|
}),
|
212
212
|
smalltalk.TestCase);
|
213
213
|
|
214
214
|
|
215
215
|
smalltalk.addMethod(
|
216
|
-
|
216
|
+
"_allTestSelectors",
|
217
217
|
smalltalk.method({
|
218
|
-
selector:
|
218
|
+
selector: "allTestSelectors",
|
219
219
|
category: 'accessing',
|
220
220
|
fn: function (){
|
221
221
|
var self=this;
|
222
|
-
|
222
|
+
var selectors=nil;
|
223
|
+
(selectors=smalltalk.send(self, "_testSelectors", []));
|
224
|
+
((($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]));
|
225
|
+
return selectors;
|
223
226
|
return self;},
|
224
227
|
args: [],
|
225
|
-
source:
|
226
|
-
messageSends: ["
|
228
|
+
source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors].\x0a\x09^selectors",
|
229
|
+
messageSends: ["testSelectors", "ifTrue:", "shouldInheritSelectors", "addAll:", "allTestSelectors", "superclass"],
|
227
230
|
referencedClasses: []
|
228
231
|
}),
|
229
232
|
smalltalk.TestCase.klass);
|
230
233
|
|
231
234
|
smalltalk.addMethod(
|
232
|
-
|
235
|
+
"_buildSuite",
|
233
236
|
smalltalk.method({
|
234
|
-
selector:
|
237
|
+
selector: "buildSuite",
|
235
238
|
category: 'accessing',
|
236
|
-
fn: function (
|
239
|
+
fn: function (){
|
237
240
|
var self=this;
|
238
|
-
return (
|
241
|
+
return smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [(function(each){return smalltalk.send(self, "_selector_", [each]);})]);
|
239
242
|
return self;},
|
240
|
-
args: [
|
241
|
-
source:
|
242
|
-
messageSends: ["
|
243
|
+
args: [],
|
244
|
+
source: "buildSuite\x0a\x09^self allTestSelectors collect: [:each | self selector: each]",
|
245
|
+
messageSends: ["collect:", "allTestSelectors", "selector:"],
|
243
246
|
referencedClasses: []
|
244
247
|
}),
|
245
248
|
smalltalk.TestCase.klass);
|
246
249
|
|
247
250
|
smalltalk.addMethod(
|
248
|
-
|
251
|
+
"_lookupHierarchyRoot",
|
249
252
|
smalltalk.method({
|
250
|
-
selector:
|
253
|
+
selector: "lookupHierarchyRoot",
|
251
254
|
category: 'accessing',
|
252
255
|
fn: function (){
|
253
256
|
var self=this;
|
254
257
|
return (smalltalk.TestCase || TestCase);
|
255
258
|
return self;},
|
256
259
|
args: [],
|
257
|
-
source:
|
260
|
+
source: "lookupHierarchyRoot\x0a\x09^TestCase",
|
258
261
|
messageSends: [],
|
259
262
|
referencedClasses: ["TestCase"]
|
260
263
|
}),
|
261
264
|
smalltalk.TestCase.klass);
|
262
265
|
|
263
266
|
smalltalk.addMethod(
|
264
|
-
|
267
|
+
"_selector_",
|
265
268
|
smalltalk.method({
|
266
|
-
selector:
|
269
|
+
selector: "selector:",
|
267
270
|
category: 'accessing',
|
268
|
-
fn: function (){
|
271
|
+
fn: function (aSelector){
|
269
272
|
var self=this;
|
270
|
-
|
271
|
-
(selectors=smalltalk.send(self, "_testSelectors", []));
|
272
|
-
((($receiver = smalltalk.send(self, "_shouldInheritSelectors", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);})]));
|
273
|
-
return selectors;
|
273
|
+
return (function($rec){smalltalk.send($rec, "_setTestSelector_", [aSelector]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
274
274
|
return self;},
|
275
|
-
args: [],
|
276
|
-
source:
|
277
|
-
messageSends: ["
|
275
|
+
args: ["aSelector"],
|
276
|
+
source: "selector: aSelector\x0a\x09^self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
|
277
|
+
messageSends: ["setTestSelector:", "yourself", "new"],
|
278
278
|
referencedClasses: []
|
279
279
|
}),
|
280
280
|
smalltalk.TestCase.klass);
|
281
281
|
|
282
282
|
smalltalk.addMethod(
|
283
|
-
|
283
|
+
"_shouldInheritSelectors",
|
284
284
|
smalltalk.method({
|
285
|
-
selector:
|
286
|
-
category: '
|
285
|
+
selector: "shouldInheritSelectors",
|
286
|
+
category: 'testing',
|
287
287
|
fn: function (){
|
288
288
|
var self=this;
|
289
|
-
return smalltalk.send(
|
289
|
+
return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
|
290
290
|
return self;},
|
291
291
|
args: [],
|
292
|
-
source:
|
293
|
-
messageSends: ["
|
292
|
+
source: "shouldInheritSelectors\x0a\x09^self ~= self lookupHierarchyRoot",
|
293
|
+
messageSends: ["~=", "lookupHierarchyRoot"],
|
294
294
|
referencedClasses: []
|
295
295
|
}),
|
296
296
|
smalltalk.TestCase.klass);
|
297
297
|
|
298
298
|
smalltalk.addMethod(
|
299
|
-
|
299
|
+
"_testSelectors",
|
300
300
|
smalltalk.method({
|
301
|
-
selector:
|
302
|
-
category: '
|
301
|
+
selector: "testSelectors",
|
302
|
+
category: 'accessing',
|
303
303
|
fn: function (){
|
304
304
|
var self=this;
|
305
|
-
return smalltalk.send(self, "
|
305
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", ["^test"]);})]);
|
306
306
|
return self;},
|
307
307
|
args: [],
|
308
|
-
source:
|
309
|
-
messageSends: [
|
308
|
+
source: "testSelectors\x0a\x09^self methodDictionary keys select: [:each | each match: '^test']",
|
309
|
+
messageSends: ["select:", "keys", "methodDictionary", "match:"],
|
310
310
|
referencedClasses: []
|
311
311
|
}),
|
312
312
|
smalltalk.TestCase.klass);
|
@@ -317,183 +317,183 @@ smalltalk.addClass('TestFailure', smalltalk.Error, [], 'SUnit');
|
|
317
317
|
|
318
318
|
smalltalk.addClass('TestResult', smalltalk.Object, ['timestamp', 'runs', 'errors', 'failures', 'total'], 'SUnit');
|
319
319
|
smalltalk.addMethod(
|
320
|
-
|
320
|
+
"_addError_",
|
321
321
|
smalltalk.method({
|
322
|
-
selector:
|
322
|
+
selector: "addError:",
|
323
323
|
category: 'accessing',
|
324
|
-
fn: function (){
|
324
|
+
fn: function (anError){
|
325
325
|
var self=this;
|
326
|
-
|
326
|
+
smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
|
327
327
|
return self;},
|
328
|
-
args: [],
|
329
|
-
source:
|
330
|
-
messageSends: [],
|
328
|
+
args: ["anError"],
|
329
|
+
source: "addError: anError\x0a\x09self errors add: anError",
|
330
|
+
messageSends: ["add:", "errors"],
|
331
331
|
referencedClasses: []
|
332
332
|
}),
|
333
333
|
smalltalk.TestResult);
|
334
334
|
|
335
335
|
smalltalk.addMethod(
|
336
|
-
|
336
|
+
"_addFailure_",
|
337
337
|
smalltalk.method({
|
338
|
-
selector:
|
338
|
+
selector: "addFailure:",
|
339
339
|
category: 'accessing',
|
340
|
-
fn: function (){
|
340
|
+
fn: function (aFailure){
|
341
341
|
var self=this;
|
342
|
-
|
342
|
+
smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
|
343
343
|
return self;},
|
344
|
-
args: [],
|
345
|
-
source:
|
346
|
-
messageSends: [],
|
344
|
+
args: ["aFailure"],
|
345
|
+
source: "addFailure: aFailure\x0a\x09self failures add: aFailure",
|
346
|
+
messageSends: ["add:", "failures"],
|
347
347
|
referencedClasses: []
|
348
348
|
}),
|
349
349
|
smalltalk.TestResult);
|
350
350
|
|
351
351
|
smalltalk.addMethod(
|
352
|
-
|
352
|
+
"_errors",
|
353
353
|
smalltalk.method({
|
354
|
-
selector:
|
354
|
+
selector: "errors",
|
355
355
|
category: 'accessing',
|
356
356
|
fn: function (){
|
357
357
|
var self=this;
|
358
|
-
return self['@
|
358
|
+
return self['@errors'];
|
359
359
|
return self;},
|
360
360
|
args: [],
|
361
|
-
source:
|
361
|
+
source: "errors\x0a\x09^errors",
|
362
362
|
messageSends: [],
|
363
363
|
referencedClasses: []
|
364
364
|
}),
|
365
365
|
smalltalk.TestResult);
|
366
366
|
|
367
367
|
smalltalk.addMethod(
|
368
|
-
|
368
|
+
"_failures",
|
369
369
|
smalltalk.method({
|
370
|
-
selector:
|
370
|
+
selector: "failures",
|
371
371
|
category: 'accessing',
|
372
372
|
fn: function (){
|
373
373
|
var self=this;
|
374
|
-
return self['@
|
374
|
+
return self['@failures'];
|
375
375
|
return self;},
|
376
376
|
args: [],
|
377
|
-
source:
|
377
|
+
source: "failures\x0a\x09^failures",
|
378
378
|
messageSends: [],
|
379
379
|
referencedClasses: []
|
380
380
|
}),
|
381
381
|
smalltalk.TestResult);
|
382
382
|
|
383
383
|
smalltalk.addMethod(
|
384
|
-
|
384
|
+
"_increaseRuns",
|
385
385
|
smalltalk.method({
|
386
|
-
selector:
|
386
|
+
selector: "increaseRuns",
|
387
387
|
category: 'accessing',
|
388
|
-
fn: function (
|
388
|
+
fn: function (){
|
389
389
|
var self=this;
|
390
|
-
(self['@
|
390
|
+
(self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
|
391
391
|
return self;},
|
392
|
-
args: [
|
393
|
-
source:
|
394
|
-
messageSends: [],
|
392
|
+
args: [],
|
393
|
+
source: "increaseRuns\x0a\x09runs := runs + 1",
|
394
|
+
messageSends: ["+"],
|
395
395
|
referencedClasses: []
|
396
396
|
}),
|
397
397
|
smalltalk.TestResult);
|
398
398
|
|
399
399
|
smalltalk.addMethod(
|
400
|
-
|
400
|
+
"_initialize",
|
401
401
|
smalltalk.method({
|
402
|
-
selector:
|
403
|
-
category: '
|
404
|
-
fn: function (
|
402
|
+
selector: "initialize",
|
403
|
+
category: 'initialization',
|
404
|
+
fn: function (){
|
405
405
|
var self=this;
|
406
|
-
smalltalk.send(
|
406
|
+
smalltalk.send(self, "_initialize", [], smalltalk.TestResult.superclass || nil);
|
407
|
+
(self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
|
408
|
+
(self['@runs']=(0));
|
409
|
+
(self['@errors']=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
410
|
+
(self['@failures']=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
411
|
+
(self['@total']=(0));
|
407
412
|
return self;},
|
408
|
-
args: [
|
409
|
-
source:
|
410
|
-
messageSends: ["
|
411
|
-
referencedClasses: []
|
413
|
+
args: [],
|
414
|
+
source: "initialize\x0a\x09super initialize.\x0a\x09timestamp := Date now.\x0a\x09runs := 0.\x0a\x09errors := Array new.\x0a\x09failures := Array new.\x0a\x09total := 0",
|
415
|
+
messageSends: ["initialize", "now", "new"],
|
416
|
+
referencedClasses: ["Date", "Array"]
|
412
417
|
}),
|
413
418
|
smalltalk.TestResult);
|
414
419
|
|
415
420
|
smalltalk.addMethod(
|
416
|
-
|
421
|
+
"_runs",
|
417
422
|
smalltalk.method({
|
418
|
-
selector:
|
423
|
+
selector: "runs",
|
419
424
|
category: 'accessing',
|
420
|
-
fn: function (
|
425
|
+
fn: function (){
|
421
426
|
var self=this;
|
422
|
-
|
427
|
+
return self['@runs'];
|
423
428
|
return self;},
|
424
|
-
args: [
|
425
|
-
source:
|
426
|
-
messageSends: [
|
429
|
+
args: [],
|
430
|
+
source: "runs\x0a\x09^runs",
|
431
|
+
messageSends: [],
|
427
432
|
referencedClasses: []
|
428
433
|
}),
|
429
434
|
smalltalk.TestResult);
|
430
435
|
|
431
436
|
smalltalk.addMethod(
|
432
|
-
|
437
|
+
"_status",
|
433
438
|
smalltalk.method({
|
434
|
-
selector:
|
439
|
+
selector: "status",
|
435
440
|
category: 'accessing',
|
436
441
|
fn: function (){
|
437
442
|
var self=this;
|
438
|
-
return self[
|
443
|
+
return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
|
439
444
|
return self;},
|
440
445
|
args: [],
|
441
|
-
source:
|
442
|
-
messageSends: [],
|
446
|
+
source: "status\x0a\x09^self errors isEmpty \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty \x0a\x09\x09\x09\x09ifTrue: ['success']\x0a\x09\x09\x09\x09ifFalse: ['failure']]\x0a\x09\x09ifFalse: ['error']",
|
447
|
+
messageSends: ["ifTrue:ifFalse:", "isEmpty", "errors", "failures"],
|
443
448
|
referencedClasses: []
|
444
449
|
}),
|
445
450
|
smalltalk.TestResult);
|
446
451
|
|
447
452
|
smalltalk.addMethod(
|
448
|
-
|
453
|
+
"_timestamp",
|
449
454
|
smalltalk.method({
|
450
|
-
selector:
|
455
|
+
selector: "timestamp",
|
451
456
|
category: 'accessing',
|
452
457
|
fn: function (){
|
453
458
|
var self=this;
|
454
|
-
|
459
|
+
return self['@timestamp'];
|
455
460
|
return self;},
|
456
461
|
args: [],
|
457
|
-
source:
|
458
|
-
messageSends: [
|
462
|
+
source: "timestamp\x0a\x09^timestamp",
|
463
|
+
messageSends: [],
|
459
464
|
referencedClasses: []
|
460
465
|
}),
|
461
466
|
smalltalk.TestResult);
|
462
467
|
|
463
468
|
smalltalk.addMethod(
|
464
|
-
|
469
|
+
"_total",
|
465
470
|
smalltalk.method({
|
466
|
-
selector:
|
471
|
+
selector: "total",
|
467
472
|
category: 'accessing',
|
468
473
|
fn: function (){
|
469
474
|
var self=this;
|
470
|
-
return
|
475
|
+
return self['@total'];
|
471
476
|
return self;},
|
472
477
|
args: [],
|
473
|
-
source:
|
474
|
-
messageSends: [
|
478
|
+
source: "total\x0a\x09^total",
|
479
|
+
messageSends: [],
|
475
480
|
referencedClasses: []
|
476
481
|
}),
|
477
482
|
smalltalk.TestResult);
|
478
483
|
|
479
484
|
smalltalk.addMethod(
|
480
|
-
|
485
|
+
"_total_",
|
481
486
|
smalltalk.method({
|
482
|
-
selector:
|
483
|
-
category: '
|
484
|
-
fn: function (){
|
487
|
+
selector: "total:",
|
488
|
+
category: 'accessing',
|
489
|
+
fn: function (aNumber){
|
485
490
|
var self=this;
|
486
|
-
|
487
|
-
(self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
|
488
|
-
(self['@runs']=(0));
|
489
|
-
(self['@errors']=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
490
|
-
(self['@failures']=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
491
|
-
(self['@total']=(0));
|
491
|
+
(self['@total']=aNumber);
|
492
492
|
return self;},
|
493
|
-
args: [],
|
494
|
-
source:
|
495
|
-
messageSends: [
|
496
|
-
referencedClasses: [
|
493
|
+
args: ["aNumber"],
|
494
|
+
source: "total: aNumber\x0a\x09total := aNumber",
|
495
|
+
messageSends: [],
|
496
|
+
referencedClasses: []
|
497
497
|
}),
|
498
498
|
smalltalk.TestResult);
|
499
499
|
|