resin 0.3.1 → 0.4.0
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/amber/bin/amberc +10 -350
- data/amber/js/Benchfib.deploy.js +80 -89
- data/amber/js/Benchfib.js +80 -89
- data/amber/js/Canvas.deploy.js +558 -545
- data/amber/js/Canvas.js +563 -545
- data/amber/js/Compiler-AST.deploy.js +431 -243
- data/amber/js/Compiler-AST.js +487 -244
- data/amber/js/Compiler-Core.deploy.js +201 -1045
- data/amber/js/Compiler-Core.js +208 -1207
- data/amber/js/Compiler-Exceptions.deploy.js +37 -18
- data/amber/js/Compiler-Exceptions.js +42 -18
- data/amber/js/Compiler-IR.deploy.js +1071 -774
- data/amber/js/Compiler-IR.js +1194 -848
- data/amber/js/Compiler-Inlining.deploy.js +395 -373
- data/amber/js/Compiler-Inlining.js +395 -373
- data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
- data/amber/js/Compiler-Interpreter.js +1631 -0
- data/amber/js/Compiler-Semantic.deploy.js +695 -600
- data/amber/js/Compiler-Semantic.js +721 -611
- data/amber/js/Compiler-Tests.deploy.js +699 -376
- data/amber/js/Compiler-Tests.js +834 -381
- data/amber/js/Compiler.deploy.js +8563 -1805
- data/amber/js/Compiler.js +11476 -2633
- data/amber/js/Examples.deploy.js +29 -29
- data/amber/js/Examples.js +29 -29
- data/amber/js/IDE.deploy.js +3292 -2649
- data/amber/js/IDE.js +3318 -2710
- data/amber/js/Importer-Exporter.deploy.js +393 -349
- data/amber/js/Importer-Exporter.js +398 -354
- data/amber/js/Kernel-Announcements.deploy.js +53 -44
- data/amber/js/Kernel-Announcements.js +55 -44
- data/amber/js/Kernel-Classes.deploy.js +566 -368
- data/amber/js/Kernel-Classes.js +660 -402
- data/amber/js/Kernel-Collections.deploy.js +1149 -1098
- data/amber/js/Kernel-Collections.js +1183 -1116
- data/amber/js/Kernel-Exceptions.deploy.js +173 -75
- data/amber/js/Kernel-Exceptions.js +215 -77
- data/amber/js/Kernel-Methods.deploy.js +530 -313
- data/amber/js/Kernel-Methods.js +632 -338
- data/amber/js/Kernel-Objects.deploy.js +1734 -1577
- data/amber/js/Kernel-Objects.js +1867 -1654
- data/amber/js/Kernel-Tests.deploy.js +1416 -973
- data/amber/js/Kernel-Tests.js +1495 -981
- data/amber/js/Kernel-Transcript.deploy.js +23 -24
- data/amber/js/Kernel-Transcript.js +25 -26
- data/amber/js/SUnit-Tests.deploy.js +402 -0
- data/amber/js/SUnit-Tests.js +518 -0
- data/amber/js/SUnit.deploy.js +535 -237
- data/amber/js/SUnit.js +634 -246
- data/amber/js/amber.js +90 -53
- data/amber/js/boot.js +441 -255
- data/amber/js/init.js +1 -3
- data/amber/js/lib/CodeMirror/codemirror.css +3 -0
- data/amber/js/lib/CodeMirror/codemirror.js +104 -55
- data/amber/js/lib/peg-0.7.0.min.js +9 -0
- data/amber/js/parser.js +1504 -802
- data/amber/js/parser.pegjs +170 -165
- data/amber/st/Canvas.st +6 -0
- data/amber/st/Compiler-AST.st +54 -3
- data/amber/st/Compiler-Core.st +6 -551
- data/amber/st/Compiler-Exceptions.st +4 -0
- data/amber/st/Compiler-IR.st +205 -87
- data/amber/st/Compiler-Interpreter.st +597 -0
- data/amber/st/Compiler-Semantic.st +46 -21
- data/amber/st/Compiler-Tests.st +254 -7
- data/amber/st/Compiler.st +3172 -1541
- data/amber/st/IDE.st +57 -93
- data/amber/st/Importer-Exporter.st +4 -7
- data/amber/st/Kernel-Announcements.st +8 -0
- data/amber/st/Kernel-Classes.st +149 -40
- data/amber/st/Kernel-Collections.st +43 -32
- data/amber/st/Kernel-Exceptions.st +70 -1
- data/amber/st/Kernel-Methods.st +165 -27
- data/amber/st/Kernel-Objects.st +215 -140
- data/amber/st/Kernel-Tests.st +195 -10
- data/amber/st/Kernel-Transcript.st +1 -3
- data/amber/st/SUnit-Tests.st +186 -0
- data/amber/st/SUnit.st +186 -14
- data/bin/resin +6 -0
- data/lib/resin/cli.rb +19 -0
- metadata +41 -25
- data/amber/js/lib/peg-0.6.2.min.js +0 -2
- data/bin/resin-compile +0 -6
- data/bin/runresin +0 -12
@@ -1,15 +1,45 @@
|
|
1
1
|
smalltalk.addPackage('Kernel-Tests', {});
|
2
2
|
smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
"_testCanClearInterval",
|
5
|
+
smalltalk.method({
|
6
|
+
selector: "testCanClearInterval",
|
7
|
+
fn: function (){
|
8
|
+
var self=this;
|
9
|
+
return smalltalk.withContext(function($ctx1) {
|
10
|
+
return smalltalk.withContext(function($ctx2) {
|
11
|
+
return smalltalk.withContext(function($ctx3) {
|
12
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithInterval_((0)))._clearInterval();
|
13
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
14
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCanClearInterval",{}, smalltalk.BlockClosureTest)})}
|
15
|
+
}),
|
16
|
+
smalltalk.BlockClosureTest);
|
17
|
+
|
18
|
+
smalltalk.addMethod(
|
19
|
+
"_testCanClearTimeout",
|
20
|
+
smalltalk.method({
|
21
|
+
selector: "testCanClearTimeout",
|
22
|
+
fn: function (){
|
23
|
+
var self=this;
|
24
|
+
return smalltalk.withContext(function($ctx1) {
|
25
|
+
return smalltalk.withContext(function($ctx2) {
|
26
|
+
return smalltalk.withContext(function($ctx3) {
|
27
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((0)))._clearTimeout();
|
28
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
29
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCanClearTimeout",{}, smalltalk.BlockClosureTest)})}
|
30
|
+
}),
|
31
|
+
smalltalk.BlockClosureTest);
|
32
|
+
|
3
33
|
smalltalk.addMethod(
|
4
34
|
"_testCompiledSource",
|
5
35
|
smalltalk.method({
|
6
36
|
selector: "testCompiledSource",
|
7
37
|
fn: function (){
|
8
38
|
var self=this;
|
9
|
-
smalltalk.
|
10
|
-
return smalltalk.
|
11
|
-
})
|
12
|
-
return self}
|
39
|
+
return smalltalk.withContext(function($ctx1) {
|
40
|
+
return smalltalk.withContext(function($ctx2) {
|
41
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._compiledSource())._includesSubString_("function"));
|
42
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCompiledSource",{}, smalltalk.BlockClosureTest)})}
|
13
43
|
}),
|
14
44
|
smalltalk.BlockClosureTest);
|
15
45
|
|
@@ -19,12 +49,12 @@ smalltalk.method({
|
|
19
49
|
selector: "testEnsure",
|
20
50
|
fn: function (){
|
21
51
|
var self=this;
|
22
|
-
smalltalk.
|
23
|
-
return smalltalk.
|
24
|
-
})
|
25
|
-
return
|
26
|
-
})
|
27
|
-
return self}
|
52
|
+
return smalltalk.withContext(function($ctx1) {
|
53
|
+
return smalltalk.withContext(function($ctx2) {
|
54
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
|
55
|
+
return smalltalk.withContext(function($ctx2) {
|
56
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
57
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{}, smalltalk.BlockClosureTest)})}
|
28
58
|
}),
|
29
59
|
smalltalk.BlockClosureTest);
|
30
60
|
|
@@ -34,14 +64,35 @@ smalltalk.method({
|
|
34
64
|
selector: "testEnsureRaises",
|
35
65
|
fn: function (){
|
36
66
|
var self=this;
|
37
|
-
smalltalk.
|
38
|
-
return smalltalk.
|
39
|
-
return smalltalk.
|
40
|
-
})
|
41
|
-
return
|
42
|
-
})
|
43
|
-
}),(smalltalk.Error || Error)
|
44
|
-
return self}
|
67
|
+
return smalltalk.withContext(function($ctx1) {
|
68
|
+
return smalltalk.withContext(function($ctx2) {
|
69
|
+
return smalltalk.withContext(function($ctx3) {
|
70
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
|
71
|
+
return smalltalk.withContext(function($ctx3) {
|
72
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
|
73
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
74
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{}, smalltalk.BlockClosureTest)})}
|
75
|
+
}),
|
76
|
+
smalltalk.BlockClosureTest);
|
77
|
+
|
78
|
+
smalltalk.addMethod(
|
79
|
+
"_testExceptionSemantics",
|
80
|
+
smalltalk.method({
|
81
|
+
selector: "testExceptionSemantics",
|
82
|
+
fn: function (){
|
83
|
+
var self=this;
|
84
|
+
return smalltalk.withContext(function($ctx1) {
|
85
|
+
_st(_st(self)._async_((function(){
|
86
|
+
return smalltalk.withContext(function($ctx2) {
|
87
|
+
return smalltalk.withContext(function($ctx3) {
|
88
|
+
_st((smalltalk.Error || Error))._signal();
|
89
|
+
_st(self)._deny_(true);
|
90
|
+
return _st(self)._finished();
|
91
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
|
92
|
+
return smalltalk.withContext(function($ctx3) {
|
93
|
+
}, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx1)})}));
|
94
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
|
95
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testExceptionSemantics",{}, smalltalk.BlockClosureTest)})}
|
45
96
|
}),
|
46
97
|
smalltalk.BlockClosureTest);
|
47
98
|
|
@@ -51,11 +102,11 @@ smalltalk.method({
|
|
51
102
|
selector: "testNumArgs",
|
52
103
|
fn: function (){
|
53
104
|
var self=this;
|
54
|
-
smalltalk.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return self}
|
105
|
+
return smalltalk.withContext(function($ctx1) {
|
106
|
+
return smalltalk.withContext(function($ctx2) {
|
107
|
+
_st(self)._assert_equals_(_st((function(a,b){
|
108
|
+
return smalltalk.withContext(function($ctx2) {
|
109
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNumArgs",{}, smalltalk.BlockClosureTest)})}
|
59
110
|
}),
|
60
111
|
smalltalk.BlockClosureTest);
|
61
112
|
|
@@ -65,12 +116,12 @@ smalltalk.method({
|
|
65
116
|
selector: "testOnDo",
|
66
117
|
fn: function (){
|
67
118
|
var self=this;
|
68
|
-
smalltalk.
|
69
|
-
return smalltalk.
|
70
|
-
})
|
71
|
-
return
|
72
|
-
})
|
73
|
-
return self}
|
119
|
+
return smalltalk.withContext(function($ctx1) {
|
120
|
+
return smalltalk.withContext(function($ctx2) {
|
121
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(ex){
|
122
|
+
return smalltalk.withContext(function($ctx2) {
|
123
|
+
}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})})));
|
124
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{}, smalltalk.BlockClosureTest)})}
|
74
125
|
}),
|
75
126
|
smalltalk.BlockClosureTest);
|
76
127
|
|
@@ -80,19 +131,19 @@ smalltalk.method({
|
|
80
131
|
selector: "testValue",
|
81
132
|
fn: function (){
|
82
133
|
var self=this;
|
83
|
-
smalltalk.
|
84
|
-
return smalltalk.
|
85
|
-
})
|
86
|
-
|
87
|
-
return smalltalk.
|
88
|
-
})
|
89
|
-
|
90
|
-
return smalltalk.
|
91
|
-
}),
|
92
|
-
|
93
|
-
return (
|
94
|
-
}),
|
95
|
-
return self}
|
134
|
+
return smalltalk.withContext(function($ctx1) {
|
135
|
+
return smalltalk.withContext(function($ctx2) {
|
136
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._value(),(2));
|
137
|
+
_st(self)._assert_equals_(_st((function(x){
|
138
|
+
return smalltalk.withContext(function($ctx2) {
|
139
|
+
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}))._value_((2)),(3));
|
140
|
+
_st(self)._assert_equals_(_st((function(x,y){
|
141
|
+
return smalltalk.withContext(function($ctx2) {
|
142
|
+
}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}))._value_value_((2),(4)),(8));
|
143
|
+
_st(self)._assert_equals_(_st((function(a,b,c){
|
144
|
+
return smalltalk.withContext(function($ctx2) {
|
145
|
+
}, function($ctx2) {$ctx2.fillBlock({a:a,b:b,c:c},$ctx1)})}))._value(),(1));
|
146
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testValue",{}, smalltalk.BlockClosureTest)})}
|
96
147
|
}),
|
97
148
|
smalltalk.BlockClosureTest);
|
98
149
|
|
@@ -102,16 +153,16 @@ smalltalk.method({
|
|
102
153
|
selector: "testValueWithPossibleArguments",
|
103
154
|
fn: function (){
|
104
155
|
var self=this;
|
105
|
-
smalltalk.
|
106
|
-
return (
|
107
|
-
})
|
108
|
-
|
109
|
-
return smalltalk.
|
110
|
-
})
|
111
|
-
|
112
|
-
return smalltalk.
|
113
|
-
}),
|
114
|
-
return self}
|
156
|
+
return smalltalk.withContext(function($ctx1) {
|
157
|
+
return smalltalk.withContext(function($ctx2) {
|
158
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(1));
|
159
|
+
_st(self)._assert_equals_(_st((function(a){
|
160
|
+
return smalltalk.withContext(function($ctx2) {
|
161
|
+
}, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}))._valueWithPossibleArguments_([(3), (4)]),(7));
|
162
|
+
_st(self)._assert_equals_(_st((function(a,b){
|
163
|
+
return smalltalk.withContext(function($ctx2) {
|
164
|
+
}, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}))._valueWithPossibleArguments_([(3), (4), (5)]),(7));
|
165
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testValueWithPossibleArguments",{}, smalltalk.BlockClosureTest)})}
|
115
166
|
}),
|
116
167
|
smalltalk.BlockClosureTest);
|
117
168
|
|
@@ -122,22 +173,22 @@ selector: "testWhileFalse",
|
|
122
173
|
fn: function (){
|
123
174
|
var self=this;
|
124
175
|
var i;
|
125
|
-
|
126
|
-
|
127
|
-
return smalltalk.
|
128
|
-
})
|
129
|
-
|
176
|
+
return smalltalk.withContext(function($ctx1) {
|
177
|
+
_st((function(){
|
178
|
+
return smalltalk.withContext(function($ctx2) {
|
179
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
|
180
|
+
return smalltalk.withContext(function($ctx2) {
|
130
181
|
return i;
|
131
|
-
})
|
132
|
-
|
182
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
183
|
+
_st(self)._assert_equals_(i,(6));
|
133
184
|
i=(0);
|
134
|
-
|
135
|
-
|
185
|
+
_st((function(){
|
186
|
+
return smalltalk.withContext(function($ctx2) {
|
136
187
|
i;
|
137
|
-
return
|
138
|
-
})
|
139
|
-
|
140
|
-
return self}
|
188
|
+
return _st(i).__gt((5));
|
189
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse();
|
190
|
+
_st(self)._assert_equals_(i,(6));
|
191
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testWhileFalse",{i:i}, smalltalk.BlockClosureTest)})}
|
141
192
|
}),
|
142
193
|
smalltalk.BlockClosureTest);
|
143
194
|
|
@@ -148,22 +199,22 @@ selector: "testWhileTrue",
|
|
148
199
|
fn: function (){
|
149
200
|
var self=this;
|
150
201
|
var i;
|
151
|
-
|
152
|
-
|
153
|
-
return smalltalk.
|
154
|
-
})
|
155
|
-
|
202
|
+
return smalltalk.withContext(function($ctx1) {
|
203
|
+
_st((function(){
|
204
|
+
return smalltalk.withContext(function($ctx2) {
|
205
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
|
206
|
+
return smalltalk.withContext(function($ctx2) {
|
156
207
|
return i;
|
157
|
-
})
|
158
|
-
|
208
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
209
|
+
_st(self)._assert_equals_(i,(5));
|
159
210
|
i=(0);
|
160
|
-
|
161
|
-
|
211
|
+
_st((function(){
|
212
|
+
return smalltalk.withContext(function($ctx2) {
|
162
213
|
i;
|
163
|
-
return
|
164
|
-
})
|
165
|
-
|
166
|
-
return self}
|
214
|
+
return _st(i).__lt((5));
|
215
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue();
|
216
|
+
_st(self)._assert_equals_(i,(5));
|
217
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testWhileTrue",{i:i}, smalltalk.BlockClosureTest)})}
|
167
218
|
}),
|
168
219
|
smalltalk.BlockClosureTest);
|
169
220
|
|
@@ -176,17 +227,17 @@ smalltalk.method({
|
|
176
227
|
selector: "testEquality",
|
177
228
|
fn: function (){
|
178
229
|
var self=this;
|
179
|
-
smalltalk.
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
return self}
|
230
|
+
return smalltalk.withContext(function($ctx1) {
|
231
|
+
_st(self)._deny_(_st(false).__eq((0)));
|
232
|
+
_st(self)._deny_(_st("").__eq(false));
|
233
|
+
_st(self)._deny_(_st(false).__eq(""));
|
234
|
+
_st(self)._assert_(_st(true).__eq(true));
|
235
|
+
_st(self)._deny_(_st(false).__eq(true));
|
236
|
+
_st(self)._deny_(_st(true).__eq(false));
|
237
|
+
_st(self)._assert_(_st(false).__eq(false));
|
238
|
+
_st(self)._assert_(_st(_st(true)._yourself()).__eq(true));
|
239
|
+
_st(self)._assert_(_st(_st(true)._yourself()).__eq(_st(true)._yourself()));
|
240
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.BooleanTest)})}
|
190
241
|
}),
|
191
242
|
smalltalk.BooleanTest);
|
192
243
|
|
@@ -196,17 +247,17 @@ smalltalk.method({
|
|
196
247
|
selector: "testIdentity",
|
197
248
|
fn: function (){
|
198
249
|
var self=this;
|
199
|
-
smalltalk.
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
return self}
|
250
|
+
return smalltalk.withContext(function($ctx1) {
|
251
|
+
_st(self)._deny_(_st(false).__eq_eq((0)));
|
252
|
+
_st(self)._deny_(_st("").__eq_eq(false));
|
253
|
+
_st(self)._deny_(_st(false).__eq_eq(""));
|
254
|
+
_st(self)._assert_(_st(true).__eq_eq(true));
|
255
|
+
_st(self)._deny_(_st(false).__eq_eq(true));
|
256
|
+
_st(self)._deny_(_st(true).__eq_eq(false));
|
257
|
+
_st(self)._assert_(_st(false).__eq_eq(false));
|
258
|
+
_st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(true));
|
259
|
+
_st(self)._assert_(_st(_st(true)._yourself()).__eq_eq(_st(true)._yourself()));
|
260
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.BooleanTest)})}
|
210
261
|
}),
|
211
262
|
smalltalk.BooleanTest);
|
212
263
|
|
@@ -216,48 +267,139 @@ smalltalk.method({
|
|
216
267
|
selector: "testIfTrueIfFalse",
|
217
268
|
fn: function (){
|
218
269
|
var self=this;
|
219
|
-
|
270
|
+
return smalltalk.withContext(function($ctx1) {
|
271
|
+
$1=self;
|
220
272
|
if(smalltalk.assert(true)){
|
221
|
-
$
|
273
|
+
$3="alternative block";
|
222
274
|
};
|
223
|
-
|
275
|
+
$2=_st($3).__eq("alternative block");
|
276
|
+
_st($1)._assert_($2);
|
277
|
+
$4=self;
|
224
278
|
if(! smalltalk.assert(true)){
|
225
|
-
$
|
279
|
+
$6="alternative block";
|
226
280
|
};
|
227
|
-
|
281
|
+
$5=_st($6).__eq(nil);
|
282
|
+
_st($4)._assert_($5);
|
283
|
+
$7=self;
|
228
284
|
if(smalltalk.assert(false)){
|
229
|
-
$
|
285
|
+
$9="alternative block";
|
230
286
|
};
|
231
|
-
|
287
|
+
$8=_st($9).__eq(nil);
|
288
|
+
_st($7)._assert_($8);
|
289
|
+
$10=self;
|
232
290
|
if(! smalltalk.assert(false)){
|
233
|
-
$
|
291
|
+
$12="alternative block";
|
234
292
|
};
|
235
|
-
|
293
|
+
$11=_st($12).__eq("alternative block");
|
294
|
+
_st($10)._assert_($11);
|
295
|
+
$13=self;
|
236
296
|
if(smalltalk.assert(false)){
|
237
|
-
$
|
297
|
+
$15="alternative block";
|
238
298
|
} else {
|
239
|
-
$
|
299
|
+
$15="alternative block2";
|
240
300
|
};
|
241
|
-
|
301
|
+
$14=_st($15).__eq("alternative block2");
|
302
|
+
_st($13)._assert_($14);
|
303
|
+
$16=self;
|
242
304
|
if(smalltalk.assert(false)){
|
243
|
-
$
|
305
|
+
$18="alternative block2";
|
244
306
|
} else {
|
245
|
-
$
|
307
|
+
$18="alternative block";
|
246
308
|
};
|
247
|
-
|
309
|
+
$17=_st($18).__eq("alternative block");
|
310
|
+
_st($16)._assert_($17);
|
311
|
+
$19=self;
|
248
312
|
if(smalltalk.assert(true)){
|
249
|
-
$
|
313
|
+
$21="alternative block";
|
250
314
|
} else {
|
251
|
-
$
|
315
|
+
$21="alternative block2";
|
252
316
|
};
|
253
|
-
|
317
|
+
$20=_st($21).__eq("alternative block");
|
318
|
+
_st($19)._assert_($20);
|
319
|
+
$22=self;
|
254
320
|
if(smalltalk.assert(true)){
|
255
|
-
$
|
321
|
+
$24="alternative block2";
|
256
322
|
} else {
|
257
|
-
$
|
323
|
+
$24="alternative block";
|
258
324
|
};
|
259
|
-
|
260
|
-
|
325
|
+
$23=_st($24).__eq("alternative block2");
|
326
|
+
_st($22)._assert_($23);
|
327
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalse",{}, smalltalk.BooleanTest)})}
|
328
|
+
}),
|
329
|
+
smalltalk.BooleanTest);
|
330
|
+
|
331
|
+
smalltalk.addMethod(
|
332
|
+
"_testIfTrueIfFalseWithBoxing",
|
333
|
+
smalltalk.method({
|
334
|
+
selector: "testIfTrueIfFalseWithBoxing",
|
335
|
+
fn: function (){
|
336
|
+
var self=this;
|
337
|
+
return smalltalk.withContext(function($ctx1) {
|
338
|
+
$1=self;
|
339
|
+
$4=_st(true)._yourself();
|
340
|
+
if(smalltalk.assert($4)){
|
341
|
+
$3="alternative block";
|
342
|
+
};
|
343
|
+
$2=_st($3).__eq("alternative block");
|
344
|
+
_st($1)._assert_($2);
|
345
|
+
$5=self;
|
346
|
+
$8=_st(true)._yourself();
|
347
|
+
if(! smalltalk.assert($8)){
|
348
|
+
$7="alternative block";
|
349
|
+
};
|
350
|
+
$6=_st($7).__eq(nil);
|
351
|
+
_st($5)._assert_($6);
|
352
|
+
$9=self;
|
353
|
+
$12=_st(false)._yourself();
|
354
|
+
if(smalltalk.assert($12)){
|
355
|
+
$11="alternative block";
|
356
|
+
};
|
357
|
+
$10=_st($11).__eq(nil);
|
358
|
+
_st($9)._assert_($10);
|
359
|
+
$13=self;
|
360
|
+
$16=_st(false)._yourself();
|
361
|
+
if(! smalltalk.assert($16)){
|
362
|
+
$15="alternative block";
|
363
|
+
};
|
364
|
+
$14=_st($15).__eq("alternative block");
|
365
|
+
_st($13)._assert_($14);
|
366
|
+
$17=self;
|
367
|
+
$20=_st(false)._yourself();
|
368
|
+
if(smalltalk.assert($20)){
|
369
|
+
$19="alternative block";
|
370
|
+
} else {
|
371
|
+
$19="alternative block2";
|
372
|
+
};
|
373
|
+
$18=_st($19).__eq("alternative block2");
|
374
|
+
_st($17)._assert_($18);
|
375
|
+
$21=self;
|
376
|
+
$24=_st(false)._yourself();
|
377
|
+
if(smalltalk.assert($24)){
|
378
|
+
$23="alternative block2";
|
379
|
+
} else {
|
380
|
+
$23="alternative block";
|
381
|
+
};
|
382
|
+
$22=_st($23).__eq("alternative block");
|
383
|
+
_st($21)._assert_($22);
|
384
|
+
$25=self;
|
385
|
+
$28=_st(true)._yourself();
|
386
|
+
if(smalltalk.assert($28)){
|
387
|
+
$27="alternative block";
|
388
|
+
} else {
|
389
|
+
$27="alternative block2";
|
390
|
+
};
|
391
|
+
$26=_st($27).__eq("alternative block");
|
392
|
+
_st($25)._assert_($26);
|
393
|
+
$29=self;
|
394
|
+
$32=_st(true)._yourself();
|
395
|
+
if(smalltalk.assert($32)){
|
396
|
+
$31="alternative block2";
|
397
|
+
} else {
|
398
|
+
$31="alternative block";
|
399
|
+
};
|
400
|
+
$30=_st($31).__eq("alternative block2");
|
401
|
+
_st($29)._assert_($30);
|
402
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfTrueIfFalseWithBoxing",{}, smalltalk.BooleanTest)})}
|
261
403
|
}),
|
262
404
|
smalltalk.BooleanTest);
|
263
405
|
|
@@ -267,22 +409,26 @@ smalltalk.method({
|
|
267
409
|
selector: "testLogic",
|
268
410
|
fn: function (){
|
269
411
|
var self=this;
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
$1
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
$
|
279
|
-
|
280
|
-
|
281
|
-
$
|
282
|
-
|
283
|
-
|
284
|
-
$
|
285
|
-
|
412
|
+
return smalltalk.withContext(function($ctx1) {
|
413
|
+
$1=self;
|
414
|
+
_st($1)._assert_(_st(true).__and(true));
|
415
|
+
_st($1)._deny_(_st(true).__and(false));
|
416
|
+
_st($1)._deny_(_st(false).__and(true));
|
417
|
+
$2=_st($1)._deny_(_st(false).__and(false));
|
418
|
+
$3=self;
|
419
|
+
_st($3)._assert_(_st(true).__or(true));
|
420
|
+
_st($3)._assert_(_st(true).__or(false));
|
421
|
+
_st($3)._assert_(_st(false).__or(true));
|
422
|
+
$4=_st($3)._deny_(_st(false).__or(false));
|
423
|
+
$5=self;
|
424
|
+
_st($5)._assert_(_st(true).__and(_st((1)).__gt((0))));
|
425
|
+
_st($5)._deny_(_st(_st((1)).__gt((0))).__and(false));
|
426
|
+
$6=_st($5)._deny_(_st(_st((1)).__gt((0))).__and(_st((1)).__gt((2))));
|
427
|
+
$7=self;
|
428
|
+
_st($7)._assert_(_st(false).__or(_st((1)).__gt((0))));
|
429
|
+
_st($7)._assert_(_st(_st((1)).__gt((0))).__or(false));
|
430
|
+
$8=_st($7)._assert_(_st(_st((1)).__gt((0))).__or(_st((1)).__gt((2))));
|
431
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testLogic",{}, smalltalk.BooleanTest)})}
|
286
432
|
}),
|
287
433
|
smalltalk.BooleanTest);
|
288
434
|
|
@@ -292,50 +438,54 @@ smalltalk.method({
|
|
292
438
|
selector: "testLogicKeywords",
|
293
439
|
fn: function (){
|
294
440
|
var self=this;
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
smalltalk.
|
312
|
-
|
313
|
-
|
314
|
-
smalltalk.
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
smalltalk.
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
return
|
325
|
-
})
|
326
|
-
$
|
327
|
-
return smalltalk.
|
328
|
-
})
|
329
|
-
|
330
|
-
return smalltalk.
|
331
|
-
})
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
441
|
+
return smalltalk.withContext(function($ctx1) {
|
442
|
+
$1=self;
|
443
|
+
_st($1)._assert_(_st(true)._and_((function(){
|
444
|
+
return smalltalk.withContext(function($ctx2) {
|
445
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
446
|
+
_st($1)._deny_(_st(true)._and_((function(){
|
447
|
+
return smalltalk.withContext(function($ctx2) {
|
448
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
449
|
+
_st($1)._deny_(_st(false)._and_((function(){
|
450
|
+
return smalltalk.withContext(function($ctx2) {
|
451
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
452
|
+
$2=_st($1)._deny_(_st(false)._and_((function(){
|
453
|
+
return smalltalk.withContext(function($ctx2) {
|
454
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
455
|
+
$3=self;
|
456
|
+
_st($3)._assert_(_st(true)._or_((function(){
|
457
|
+
return smalltalk.withContext(function($ctx2) {
|
458
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
459
|
+
_st($3)._assert_(_st(true)._or_((function(){
|
460
|
+
return smalltalk.withContext(function($ctx2) {
|
461
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
462
|
+
_st($3)._assert_(_st(false)._or_((function(){
|
463
|
+
return smalltalk.withContext(function($ctx2) {
|
464
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
465
|
+
$4=_st($3)._deny_(_st(false)._or_((function(){
|
466
|
+
return smalltalk.withContext(function($ctx2) {
|
467
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
468
|
+
$5=self;
|
469
|
+
_st($5)._assert_(_st(true)._and_((function(){
|
470
|
+
return smalltalk.withContext(function($ctx2) {
|
471
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
472
|
+
_st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
|
473
|
+
return smalltalk.withContext(function($ctx2) {
|
474
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
475
|
+
$6=_st($5)._deny_(_st(_st((1)).__gt((0)))._and_((function(){
|
476
|
+
return smalltalk.withContext(function($ctx2) {
|
477
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
478
|
+
$7=self;
|
479
|
+
_st($7)._assert_(_st(false)._or_((function(){
|
480
|
+
return smalltalk.withContext(function($ctx2) {
|
481
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
482
|
+
_st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
|
483
|
+
return smalltalk.withContext(function($ctx2) {
|
484
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
485
|
+
$8=_st($7)._assert_(_st(_st((1)).__gt((0)))._or_((function(){
|
486
|
+
return smalltalk.withContext(function($ctx2) {
|
487
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
488
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testLogicKeywords",{}, smalltalk.BooleanTest)})}
|
339
489
|
}),
|
340
490
|
smalltalk.BooleanTest);
|
341
491
|
|
@@ -345,15 +495,15 @@ smalltalk.method({
|
|
345
495
|
selector: "testNonBooleanError",
|
346
496
|
fn: function (){
|
347
497
|
var self=this;
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
smalltalk.
|
352
|
-
if(smalltalk.assert(self["@nonBoolean"])){
|
498
|
+
return smalltalk.withContext(function($ctx1) {
|
499
|
+
$1=self;
|
500
|
+
$2=(function(){
|
501
|
+
return smalltalk.withContext(function($ctx2) {
|
353
502
|
} else {
|
354
503
|
};
|
355
|
-
}
|
356
|
-
|
504
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
|
505
|
+
_st($1)._should_raise_($2,(smalltalk.NonBooleanReceiver || NonBooleanReceiver));
|
506
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNonBooleanError",{}, smalltalk.BooleanTest)})}
|
357
507
|
}),
|
358
508
|
smalltalk.BooleanTest);
|
359
509
|
|
@@ -366,8 +516,8 @@ smalltalk.method({
|
|
366
516
|
selector: "setUp",
|
367
517
|
fn: function (){
|
368
518
|
var self=this;
|
369
|
-
|
370
|
-
return self}
|
519
|
+
return smalltalk.withContext(function($ctx1) {
|
520
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.ClassBuilderTest)})}
|
371
521
|
}),
|
372
522
|
smalltalk.ClassBuilderTest);
|
373
523
|
|
@@ -377,14 +527,16 @@ smalltalk.method({
|
|
377
527
|
selector: "tearDown",
|
378
528
|
fn: function (){
|
379
529
|
var self=this;
|
380
|
-
|
381
|
-
self["@theClass"];
|
530
|
+
return smalltalk.withContext(function($ctx1) {
|
531
|
+
$1=self["@theClass"];
|
532
|
+
if(($receiver = $1) == nil || $receiver == undefined){
|
533
|
+
$1;
|
382
534
|
} else {
|
383
|
-
|
535
|
+
_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(self["@theClass"]);
|
384
536
|
self["@theClass"]=nil;
|
385
537
|
self["@theClass"];
|
386
538
|
};
|
387
|
-
return self}
|
539
|
+
return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{}, smalltalk.ClassBuilderTest)})}
|
388
540
|
}),
|
389
541
|
smalltalk.ClassBuilderTest);
|
390
542
|
|
@@ -394,13 +546,72 @@ smalltalk.method({
|
|
394
546
|
selector: "testClassCopy",
|
395
547
|
fn: function (){
|
396
548
|
var self=this;
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
return self}
|
549
|
+
return smalltalk.withContext(function($ctx1) {
|
550
|
+
_st(self)._assert_(_st(_st(self["@theClass"])._superclass()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._superclass()));
|
551
|
+
_st(self)._assert_(_st(_st(self["@theClass"])._instanceVariableNames()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._instanceVariableNames()));
|
552
|
+
_st(self)._assert_equals_(_st(self["@theClass"])._name(),"ObjectMock2");
|
553
|
+
_st(self)._assert_(_st(_st(self["@theClass"])._package()).__eq_eq(_st((smalltalk.ObjectMock || ObjectMock))._package()));
|
554
|
+
_st(self)._assert_equals_(_st(_st(self["@theClass"])._methodDictionary())._keys(),_st(_st((smalltalk.ObjectMock || ObjectMock))._methodDictionary())._keys());
|
555
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testClassCopy",{}, smalltalk.ClassBuilderTest)})}
|
556
|
+
}),
|
557
|
+
smalltalk.ClassBuilderTest);
|
558
|
+
|
559
|
+
smalltalk.addMethod(
|
560
|
+
"_testClassMigration",
|
561
|
+
smalltalk.method({
|
562
|
+
selector: "testClassMigration",
|
563
|
+
fn: function (){
|
564
|
+
var self=this;
|
565
|
+
var instance,oldClass;
|
566
|
+
return smalltalk.withContext(function($ctx1) {
|
567
|
+
instance=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"))._new();
|
568
|
+
_st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
|
569
|
+
_st(self)._deny_(_st(oldClass).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
|
570
|
+
_st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._superclass()).__eq_eq((smalltalk.ObjectMock || ObjectMock)));
|
571
|
+
_st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._instanceVariableNames())._isEmpty());
|
572
|
+
_st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._selectors(),_st(oldClass)._selectors());
|
573
|
+
_st(self)._assert_equals_(_st((smalltalk.ObjectMock2 || ObjectMock2))._comment(),_st(oldClass)._comment());
|
574
|
+
_st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._package())._name(),"Kernel-Tests");
|
575
|
+
_st(self)._deny_(_st(_st(instance)._class()).__eq_eq((smalltalk.ObjectMock2 || ObjectMock2)));
|
576
|
+
_st(self)._assert_equals_(_st(_st(instance)._class())._name(),"OldObjectMock2");
|
577
|
+
_st(self)._assert_(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("OldObjectMock2"))._isNil());
|
578
|
+
_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
|
579
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testClassMigration",{instance:instance,oldClass:oldClass}, smalltalk.ClassBuilderTest)})}
|
580
|
+
}),
|
581
|
+
smalltalk.ClassBuilderTest);
|
582
|
+
|
583
|
+
smalltalk.addMethod(
|
584
|
+
"_testClassMigrationWithClassInstanceVariables",
|
585
|
+
smalltalk.method({
|
586
|
+
selector: "testClassMigrationWithClassInstanceVariables",
|
587
|
+
fn: function (){
|
588
|
+
var self=this;
|
589
|
+
return smalltalk.withContext(function($ctx1) {
|
590
|
+
_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames_("foo bar");
|
591
|
+
_st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
|
592
|
+
_st(self)._assert_equals_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._class())._instanceVariableNames(),["foo", "bar"]);
|
593
|
+
_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_((smalltalk.ObjectMock2 || ObjectMock2));
|
594
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithClassInstanceVariables",{}, smalltalk.ClassBuilderTest)})}
|
595
|
+
}),
|
596
|
+
smalltalk.ClassBuilderTest);
|
597
|
+
|
598
|
+
smalltalk.addMethod(
|
599
|
+
"_testClassMigrationWithSubclasses",
|
600
|
+
smalltalk.method({
|
601
|
+
selector: "testClassMigrationWithSubclasses",
|
602
|
+
fn: function (){
|
603
|
+
var self=this;
|
604
|
+
return smalltalk.withContext(function($ctx1) {
|
605
|
+
_st((smalltalk.ObjectMock2 || ObjectMock2))._subclass_instanceVariableNames_package_("ObjectMock3","","Kernel-Tests");
|
606
|
+
_st((smalltalk.ObjectMock3 || ObjectMock3))._subclass_instanceVariableNames_package_("ObjectMock4","","Kernel-Tests");
|
607
|
+
_st((smalltalk.ObjectMock || ObjectMock))._subclass_instanceVariableNames_package_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_("ObjectMock2"),"","Kernel-Tests");
|
608
|
+
_st(self)._assert_(_st(_st((smalltalk.ObjectMock || ObjectMock))._subclasses())._includes_((smalltalk.ObjectMock2 || ObjectMock2)));
|
609
|
+
_st(self)._assert_(_st(_st((smalltalk.ObjectMock2 || ObjectMock2))._subclasses())._includes_((smalltalk.ObjectMock3 || ObjectMock3)));
|
610
|
+
_st(self)._assert_(_st(_st((smalltalk.ObjectMock3 || ObjectMock3))._subclasses())._includes_((smalltalk.ObjectMock4 || ObjectMock4)));
|
611
|
+
_st(_st((smalltalk.ObjectMock || ObjectMock))._allSubclasses())._do_((function(each){
|
612
|
+
return smalltalk.withContext(function($ctx2) {
|
613
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
614
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testClassMigrationWithSubclasses",{}, smalltalk.ClassBuilderTest)})}
|
404
615
|
}),
|
405
616
|
smalltalk.ClassBuilderTest);
|
406
617
|
|
@@ -410,8 +621,8 @@ smalltalk.method({
|
|
410
621
|
selector: "testInstanceVariableNames",
|
411
622
|
fn: function (){
|
412
623
|
var self=this;
|
413
|
-
smalltalk.
|
414
|
-
return self}
|
624
|
+
return smalltalk.withContext(function($ctx1) {
|
625
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInstanceVariableNames",{}, smalltalk.ClassBuilderTest)})}
|
415
626
|
}),
|
416
627
|
smalltalk.ClassBuilderTest);
|
417
628
|
|
@@ -424,11 +635,11 @@ smalltalk.method({
|
|
424
635
|
selector: "assertSameContents:as:",
|
425
636
|
fn: function (aCollection,anotherCollection){
|
426
637
|
var self=this;
|
427
|
-
smalltalk.
|
428
|
-
|
429
|
-
return smalltalk.
|
430
|
-
})
|
431
|
-
return self}
|
638
|
+
return smalltalk.withContext(function($ctx1) {
|
639
|
+
_st(aCollection)._do_((function(each){
|
640
|
+
return smalltalk.withContext(function($ctx2) {
|
641
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
642
|
+
return self}, function($ctx1) {$ctx1.fill(self,"assertSameContents:as:",{aCollection:aCollection,anotherCollection:anotherCollection}, smalltalk.CollectionTest)})}
|
432
643
|
}),
|
433
644
|
smalltalk.CollectionTest);
|
434
645
|
|
@@ -438,10 +649,10 @@ smalltalk.method({
|
|
438
649
|
selector: "collection",
|
439
650
|
fn: function (){
|
440
651
|
var self=this;
|
441
|
-
|
442
|
-
$1=
|
652
|
+
return smalltalk.withContext(function($ctx1) {
|
653
|
+
$1=_st(_st(self)._collectionClass())._withAll_(_st(self)._defaultValues());
|
443
654
|
return $1;
|
444
|
-
}
|
655
|
+
}, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.CollectionTest)})}
|
445
656
|
}),
|
446
657
|
smalltalk.CollectionTest);
|
447
658
|
|
@@ -451,10 +662,10 @@ smalltalk.method({
|
|
451
662
|
selector: "collectionClass",
|
452
663
|
fn: function (){
|
453
664
|
var self=this;
|
454
|
-
|
455
|
-
$1=
|
665
|
+
return smalltalk.withContext(function($ctx1) {
|
666
|
+
$1=_st(_st(self)._class())._collectionClass();
|
456
667
|
return $1;
|
457
|
-
}
|
668
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.CollectionTest)})}
|
458
669
|
}),
|
459
670
|
smalltalk.CollectionTest);
|
460
671
|
|
@@ -464,10 +675,10 @@ smalltalk.method({
|
|
464
675
|
selector: "collectionWithDuplicates",
|
465
676
|
fn: function (){
|
466
677
|
var self=this;
|
467
|
-
|
468
|
-
$1=
|
678
|
+
return smalltalk.withContext(function($ctx1) {
|
679
|
+
$1=_st(_st(self)._collectionClass())._withAll_(["a", "b", "c", (1), (2), (1), "a"]);
|
469
680
|
return $1;
|
470
|
-
}
|
681
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.CollectionTest)})}
|
471
682
|
}),
|
472
683
|
smalltalk.CollectionTest);
|
473
684
|
|
@@ -477,8 +688,8 @@ smalltalk.method({
|
|
477
688
|
selector: "defaultValues",
|
478
689
|
fn: function (){
|
479
690
|
var self=this;
|
480
|
-
return
|
481
|
-
}
|
691
|
+
return smalltalk.withContext(function($ctx1) {
|
692
|
+
}, function($ctx1) {$ctx1.fill(self,"defaultValues",{}, smalltalk.CollectionTest)})}
|
482
693
|
}),
|
483
694
|
smalltalk.CollectionTest);
|
484
695
|
|
@@ -488,8 +699,8 @@ smalltalk.method({
|
|
488
699
|
selector: "isCollectionReadOnly",
|
489
700
|
fn: function (){
|
490
701
|
var self=this;
|
491
|
-
return
|
492
|
-
}
|
702
|
+
return smalltalk.withContext(function($ctx1) {
|
703
|
+
}, function($ctx1) {$ctx1.fill(self,"isCollectionReadOnly",{}, smalltalk.CollectionTest)})}
|
493
704
|
}),
|
494
705
|
smalltalk.CollectionTest);
|
495
706
|
|
@@ -499,8 +710,8 @@ smalltalk.method({
|
|
499
710
|
selector: "testAsArray",
|
500
711
|
fn: function (){
|
501
712
|
var self=this;
|
502
|
-
smalltalk.
|
503
|
-
return self}
|
713
|
+
return smalltalk.withContext(function($ctx1) {
|
714
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{}, smalltalk.CollectionTest)})}
|
504
715
|
}),
|
505
716
|
smalltalk.CollectionTest);
|
506
717
|
|
@@ -510,8 +721,8 @@ smalltalk.method({
|
|
510
721
|
selector: "testAsOrderedCollection",
|
511
722
|
fn: function (){
|
512
723
|
var self=this;
|
513
|
-
smalltalk.
|
514
|
-
return self}
|
724
|
+
return smalltalk.withContext(function($ctx1) {
|
725
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsOrderedCollection",{}, smalltalk.CollectionTest)})}
|
515
726
|
}),
|
516
727
|
smalltalk.CollectionTest);
|
517
728
|
|
@@ -521,15 +732,14 @@ smalltalk.method({
|
|
521
732
|
selector: "testAsSet",
|
522
733
|
fn: function (){
|
523
734
|
var self=this;
|
524
|
-
var c;
|
525
|
-
|
526
|
-
c
|
527
|
-
set
|
528
|
-
|
529
|
-
smalltalk.
|
530
|
-
|
531
|
-
})
|
532
|
-
return self}
|
735
|
+
var c,set;
|
736
|
+
return smalltalk.withContext(function($ctx1) {
|
737
|
+
set=_st(c)._asSet();
|
738
|
+
_st(self)._assert_(_st(_st(set)._size()).__eq((5)));
|
739
|
+
_st(c)._do_((function(each){
|
740
|
+
return smalltalk.withContext(function($ctx2) {
|
741
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
742
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsSet",{c:c,set:set}, smalltalk.CollectionTest)})}
|
533
743
|
}),
|
534
744
|
smalltalk.CollectionTest);
|
535
745
|
|
@@ -540,11 +750,11 @@ selector: "testCollect",
|
|
540
750
|
fn: function (){
|
541
751
|
var self=this;
|
542
752
|
var newCollection;
|
543
|
-
|
544
|
-
|
545
|
-
return smalltalk.
|
546
|
-
})
|
547
|
-
return self}
|
753
|
+
return smalltalk.withContext(function($ctx1) {
|
754
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
|
755
|
+
return smalltalk.withContext(function($ctx2) {
|
756
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
757
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.CollectionTest)})}
|
548
758
|
}),
|
549
759
|
smalltalk.CollectionTest);
|
550
760
|
|
@@ -554,15 +764,15 @@ smalltalk.method({
|
|
554
764
|
selector: "testDetect",
|
555
765
|
fn: function (){
|
556
766
|
var self=this;
|
557
|
-
smalltalk.
|
558
|
-
return smalltalk.
|
559
|
-
})
|
560
|
-
|
561
|
-
return smalltalk.
|
562
|
-
return smalltalk.
|
563
|
-
})
|
564
|
-
}),(smalltalk.Error || Error)
|
565
|
-
return self}
|
767
|
+
return smalltalk.withContext(function($ctx1) {
|
768
|
+
return smalltalk.withContext(function($ctx2) {
|
769
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq((-4)));
|
770
|
+
_st(self)._should_raise_((function(){
|
771
|
+
return smalltalk.withContext(function($ctx2) {
|
772
|
+
return smalltalk.withContext(function($ctx3) {
|
773
|
+
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
|
774
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
775
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.CollectionTest)})}
|
566
776
|
}),
|
567
777
|
smalltalk.CollectionTest);
|
568
778
|
|
@@ -573,12 +783,12 @@ selector: "testDo",
|
|
573
783
|
fn: function (){
|
574
784
|
var self=this;
|
575
785
|
var newCollection;
|
576
|
-
|
577
|
-
|
578
|
-
return smalltalk.
|
579
|
-
})
|
580
|
-
|
581
|
-
return self}
|
786
|
+
return smalltalk.withContext(function($ctx1) {
|
787
|
+
_st(_st(self)._collection())._do_((function(each){
|
788
|
+
return smalltalk.withContext(function($ctx2) {
|
789
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
790
|
+
_st(self)._assertSameContents_as_(_st(self)._collection(),newCollection);
|
791
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDo",{newCollection:newCollection}, smalltalk.CollectionTest)})}
|
582
792
|
}),
|
583
793
|
smalltalk.CollectionTest);
|
584
794
|
|
@@ -588,9 +798,9 @@ smalltalk.method({
|
|
588
798
|
selector: "testIsEmpty",
|
589
799
|
fn: function (){
|
590
800
|
var self=this;
|
591
|
-
smalltalk.
|
592
|
-
|
593
|
-
return self}
|
801
|
+
return smalltalk.withContext(function($ctx1) {
|
802
|
+
_st(self)._deny_(_st(_st(self)._collection())._isEmpty());
|
803
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{}, smalltalk.CollectionTest)})}
|
594
804
|
}),
|
595
805
|
smalltalk.CollectionTest);
|
596
806
|
|
@@ -601,11 +811,11 @@ selector: "testSelect",
|
|
601
811
|
fn: function (){
|
602
812
|
var self=this;
|
603
813
|
var newCollection;
|
604
|
-
|
605
|
-
|
606
|
-
return smalltalk.
|
607
|
-
})
|
608
|
-
return self}
|
814
|
+
return smalltalk.withContext(function($ctx1) {
|
815
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
|
816
|
+
return smalltalk.withContext(function($ctx2) {
|
817
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
818
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.CollectionTest)})}
|
609
819
|
}),
|
610
820
|
smalltalk.CollectionTest);
|
611
821
|
|
@@ -615,9 +825,9 @@ smalltalk.method({
|
|
615
825
|
selector: "testSize",
|
616
826
|
fn: function (){
|
617
827
|
var self=this;
|
618
|
-
smalltalk.
|
619
|
-
|
620
|
-
return self}
|
828
|
+
return smalltalk.withContext(function($ctx1) {
|
829
|
+
_st(self)._assert_(_st(_st(_st(self)._collection())._size()).__eq((4)));
|
830
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.CollectionTest)})}
|
621
831
|
}),
|
622
832
|
smalltalk.CollectionTest);
|
623
833
|
|
@@ -628,8 +838,8 @@ smalltalk.method({
|
|
628
838
|
selector: "collectionClass",
|
629
839
|
fn: function (){
|
630
840
|
var self=this;
|
631
|
-
return
|
632
|
-
}
|
841
|
+
return smalltalk.withContext(function($ctx1) {
|
842
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.CollectionTest.klass)})}
|
633
843
|
}),
|
634
844
|
smalltalk.CollectionTest.klass);
|
635
845
|
|
@@ -639,10 +849,10 @@ smalltalk.method({
|
|
639
849
|
selector: "isAbstract",
|
640
850
|
fn: function (){
|
641
851
|
var self=this;
|
642
|
-
|
643
|
-
$1=
|
852
|
+
return smalltalk.withContext(function($ctx1) {
|
853
|
+
$1=_st(_st(self)._collectionClass())._isNil();
|
644
854
|
return $1;
|
645
|
-
}
|
855
|
+
}, function($ctx1) {$ctx1.fill(self,"isAbstract",{}, smalltalk.CollectionTest.klass)})}
|
646
856
|
}),
|
647
857
|
smalltalk.CollectionTest.klass);
|
648
858
|
|
@@ -654,10 +864,10 @@ smalltalk.method({
|
|
654
864
|
selector: "collection",
|
655
865
|
fn: function (){
|
656
866
|
var self=this;
|
657
|
-
|
658
|
-
$1=smalltalk.HashedCollection._fromPairs_([
|
867
|
+
return smalltalk.withContext(function($ctx1) {
|
868
|
+
$1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4))]);
|
659
869
|
return $1;
|
660
|
-
}
|
870
|
+
}, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.HashedCollectionTest)})}
|
661
871
|
}),
|
662
872
|
smalltalk.HashedCollectionTest);
|
663
873
|
|
@@ -667,10 +877,10 @@ smalltalk.method({
|
|
667
877
|
selector: "collectionWithDuplicates",
|
668
878
|
fn: function (){
|
669
879
|
var self=this;
|
670
|
-
|
671
|
-
$1=smalltalk.HashedCollection._fromPairs_([
|
880
|
+
return smalltalk.withContext(function($ctx1) {
|
881
|
+
$1=smalltalk.HashedCollection._fromPairs_([_st("a").__minus_gt((1)),_st("b").__minus_gt((2)),_st("c").__minus_gt((3)),_st("d").__minus_gt((-4)),_st("e").__minus_gt((1)),_st("f").__minus_gt((2)),_st("g").__minus_gt((10))]);
|
672
882
|
return $1;
|
673
|
-
}
|
883
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.HashedCollectionTest)})}
|
674
884
|
}),
|
675
885
|
smalltalk.HashedCollectionTest);
|
676
886
|
|
@@ -681,8 +891,10 @@ smalltalk.method({
|
|
681
891
|
selector: "collectionClass",
|
682
892
|
fn: function (){
|
683
893
|
var self=this;
|
684
|
-
return
|
685
|
-
|
894
|
+
return smalltalk.withContext(function($ctx1) {
|
895
|
+
$1=(smalltalk.HashedCollection || HashedCollection);
|
896
|
+
return $1;
|
897
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.HashedCollectionTest.klass)})}
|
686
898
|
}),
|
687
899
|
smalltalk.HashedCollectionTest.klass);
|
688
900
|
|
@@ -694,16 +906,16 @@ smalltalk.method({
|
|
694
906
|
selector: "collection",
|
695
907
|
fn: function (){
|
696
908
|
var self=this;
|
697
|
-
|
698
|
-
$2=
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
$3=
|
909
|
+
return smalltalk.withContext(function($ctx1) {
|
910
|
+
$2=_st((smalltalk.Dictionary || Dictionary))._new();
|
911
|
+
_st($2)._at_put_((1),(1));
|
912
|
+
_st($2)._at_put_("a",(2));
|
913
|
+
_st($2)._at_put_(true,(3));
|
914
|
+
_st($2)._at_put_((4),(-4));
|
915
|
+
$3=_st($2)._yourself();
|
704
916
|
$1=$3;
|
705
917
|
return $1;
|
706
|
-
}
|
918
|
+
}, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.DictionaryTest)})}
|
707
919
|
}),
|
708
920
|
smalltalk.DictionaryTest);
|
709
921
|
|
@@ -713,19 +925,19 @@ smalltalk.method({
|
|
713
925
|
selector: "collectionWithDuplicates",
|
714
926
|
fn: function (){
|
715
927
|
var self=this;
|
716
|
-
|
717
|
-
$2=
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
$3=
|
928
|
+
return smalltalk.withContext(function($ctx1) {
|
929
|
+
$2=_st((smalltalk.Dictionary || Dictionary))._new();
|
930
|
+
_st($2)._at_put_((1),(1));
|
931
|
+
_st($2)._at_put_("a",(2));
|
932
|
+
_st($2)._at_put_(true,(3));
|
933
|
+
_st($2)._at_put_((4),(-4));
|
934
|
+
_st($2)._at_put_("b",(1));
|
935
|
+
_st($2)._at_put_((3),(3));
|
936
|
+
_st($2)._at_put_(false,(12));
|
937
|
+
$3=_st($2)._yourself();
|
726
938
|
$1=$3;
|
727
939
|
return $1;
|
728
|
-
}
|
940
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.DictionaryTest)})}
|
729
941
|
}),
|
730
942
|
smalltalk.DictionaryTest);
|
731
943
|
|
@@ -736,20 +948,20 @@ selector: "testAccessing",
|
|
736
948
|
fn: function (){
|
737
949
|
var self=this;
|
738
950
|
var d;
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
return
|
744
|
-
})
|
745
|
-
|
746
|
-
return
|
747
|
-
})
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
return self}
|
951
|
+
return smalltalk.withContext(function($ctx1) {
|
952
|
+
_st(d)._at_put_("hello","world");
|
953
|
+
_st(self)._assert_(_st(_st(d)._at_("hello")).__eq("world"));
|
954
|
+
_st(self)._assert_(_st(_st(d)._at_ifAbsent_("hello",(function(){
|
955
|
+
return smalltalk.withContext(function($ctx2) {
|
956
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
|
957
|
+
_st(self)._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
|
958
|
+
return smalltalk.withContext(function($ctx2) {
|
959
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("world"));
|
960
|
+
_st(d)._at_put_((1),(2));
|
961
|
+
_st(self)._assert_(_st(_st(d)._at_((1))).__eq((2)));
|
962
|
+
_st(d)._at_put_(_st((1)).__at((3)),(3));
|
963
|
+
_st(self)._assert_(_st(_st(d)._at_(_st((1)).__at((3)))).__eq((3)));
|
964
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{d:d}, smalltalk.DictionaryTest)})}
|
753
965
|
}),
|
754
966
|
smalltalk.DictionaryTest);
|
755
967
|
|
@@ -759,8 +971,8 @@ smalltalk.method({
|
|
759
971
|
selector: "testDynamicDictionaries",
|
760
972
|
fn: function (){
|
761
973
|
var self=this;
|
762
|
-
smalltalk.
|
763
|
-
return self}
|
974
|
+
return smalltalk.withContext(function($ctx1) {
|
975
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{}, smalltalk.DictionaryTest)})}
|
764
976
|
}),
|
765
977
|
smalltalk.DictionaryTest);
|
766
978
|
|
@@ -770,36 +982,35 @@ smalltalk.method({
|
|
770
982
|
selector: "testEquality",
|
771
983
|
fn: function (){
|
772
984
|
var self=this;
|
773
|
-
var
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
$1
|
778
|
-
|
779
|
-
$2=smalltalk.send($1,"_yourself",[]);
|
985
|
+
var d1,d2;
|
986
|
+
return smalltalk.withContext(function($ctx1) {
|
987
|
+
_st(self)._assert_(_st(_st((smalltalk.Dictionary || Dictionary))._new()).__eq(_st((smalltalk.Dictionary || Dictionary))._new()));
|
988
|
+
$1=_st((smalltalk.Dictionary || Dictionary))._new();
|
989
|
+
_st($1)._at_put_((1),(2));
|
990
|
+
$2=_st($1)._yourself();
|
780
991
|
d1=$2;
|
781
|
-
$3=
|
782
|
-
|
783
|
-
$4=
|
992
|
+
$3=_st((smalltalk.Dictionary || Dictionary))._new();
|
993
|
+
_st($3)._at_put_((1),(2));
|
994
|
+
$4=_st($3)._yourself();
|
784
995
|
d2=$4;
|
785
|
-
|
786
|
-
$5=
|
787
|
-
|
788
|
-
$6=
|
996
|
+
_st(self)._assert_(_st(d1).__eq(d2));
|
997
|
+
$5=_st((smalltalk.Dictionary || Dictionary))._new();
|
998
|
+
_st($5)._at_put_((1),(3));
|
999
|
+
$6=_st($5)._yourself();
|
789
1000
|
d2=$6;
|
790
|
-
|
791
|
-
$7=
|
792
|
-
|
793
|
-
$8=
|
1001
|
+
_st(self)._deny_(_st(d1).__eq(d2));
|
1002
|
+
$7=_st((smalltalk.Dictionary || Dictionary))._new();
|
1003
|
+
_st($7)._at_put_((2),(2));
|
1004
|
+
$8=_st($7)._yourself();
|
794
1005
|
d2=$8;
|
795
|
-
|
796
|
-
$9=
|
797
|
-
|
798
|
-
|
799
|
-
$10=
|
1006
|
+
_st(self)._deny_(_st(d1).__eq(d2));
|
1007
|
+
$9=_st((smalltalk.Dictionary || Dictionary))._new();
|
1008
|
+
_st($9)._at_put_((1),(2));
|
1009
|
+
_st($9)._at_put_((3),(4));
|
1010
|
+
$10=_st($9)._yourself();
|
800
1011
|
d2=$10;
|
801
|
-
|
802
|
-
return self}
|
1012
|
+
_st(self)._deny_(_st(d1).__eq(d2));
|
1013
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{d1:d1,d2:d2}, smalltalk.DictionaryTest)})}
|
803
1014
|
}),
|
804
1015
|
smalltalk.DictionaryTest);
|
805
1016
|
|
@@ -809,16 +1020,15 @@ smalltalk.method({
|
|
809
1020
|
selector: "testIfAbsent",
|
810
1021
|
fn: function (){
|
811
1022
|
var self=this;
|
812
|
-
var d;
|
813
|
-
|
814
|
-
|
815
|
-
d
|
816
|
-
smalltalk.
|
817
|
-
visited=true;
|
1023
|
+
var d,visited;
|
1024
|
+
return smalltalk.withContext(function($ctx1) {
|
1025
|
+
d=_st((smalltalk.Dictionary || Dictionary))._new();
|
1026
|
+
_st(d)._at_ifAbsent_("hello",(function(){
|
1027
|
+
return smalltalk.withContext(function($ctx2) {
|
818
1028
|
return visited;
|
819
|
-
})
|
820
|
-
|
821
|
-
return self}
|
1029
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
1030
|
+
_st(self)._assert_(visited);
|
1031
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfAbsent",{d:d,visited:visited}, smalltalk.DictionaryTest)})}
|
822
1032
|
}),
|
823
1033
|
smalltalk.DictionaryTest);
|
824
1034
|
|
@@ -828,23 +1038,21 @@ smalltalk.method({
|
|
828
1038
|
selector: "testIfPresent",
|
829
1039
|
fn: function (){
|
830
1040
|
var self=this;
|
831
|
-
var d;
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
d
|
836
|
-
smalltalk.
|
837
|
-
smalltalk.send(d,"_at_ifPresent_",["hello",(function(value){
|
838
|
-
visited=value;
|
1041
|
+
var d,visited,absent;
|
1042
|
+
return smalltalk.withContext(function($ctx1) {
|
1043
|
+
d=_st((smalltalk.Dictionary || Dictionary))._new();
|
1044
|
+
_st(d)._at_put_("hello","world");
|
1045
|
+
_st(d)._at_ifPresent_("hello",(function(value){
|
1046
|
+
return smalltalk.withContext(function($ctx2) {
|
839
1047
|
return visited;
|
840
|
-
})
|
841
|
-
|
842
|
-
absent=
|
843
|
-
|
1048
|
+
}, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
|
1049
|
+
_st(self)._assert_(_st(visited).__eq("world"));
|
1050
|
+
absent=_st(d)._at_ifPresent_("bye",(function(value){
|
1051
|
+
return smalltalk.withContext(function($ctx2) {
|
844
1052
|
return visited;
|
845
|
-
})
|
846
|
-
|
847
|
-
return self}
|
1053
|
+
}, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
|
1054
|
+
_st(self)._assert_(_st(absent)._isNil());
|
1055
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfPresent",{d:d,visited:visited,absent:absent}, smalltalk.DictionaryTest)})}
|
848
1056
|
}),
|
849
1057
|
smalltalk.DictionaryTest);
|
850
1058
|
|
@@ -854,28 +1062,27 @@ smalltalk.method({
|
|
854
1062
|
selector: "testIfPresentIfAbsent",
|
855
1063
|
fn: function (){
|
856
1064
|
var self=this;
|
857
|
-
var d;
|
858
|
-
|
859
|
-
|
860
|
-
d
|
861
|
-
|
862
|
-
smalltalk.
|
863
|
-
visited=value;
|
1065
|
+
var d,visited;
|
1066
|
+
return smalltalk.withContext(function($ctx1) {
|
1067
|
+
d=_st((smalltalk.Dictionary || Dictionary))._new();
|
1068
|
+
_st(d)._at_put_("hello","world");
|
1069
|
+
_st(d)._at_ifPresent_ifAbsent_("hello",(function(value){
|
1070
|
+
return smalltalk.withContext(function($ctx2) {
|
864
1071
|
return visited;
|
865
|
-
}),(function(){
|
866
|
-
|
1072
|
+
}, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
|
1073
|
+
return smalltalk.withContext(function($ctx2) {
|
867
1074
|
return visited;
|
868
|
-
})
|
869
|
-
|
870
|
-
|
871
|
-
|
1075
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
1076
|
+
_st(self)._assert_(_st(visited).__eq("world"));
|
1077
|
+
_st(d)._at_ifPresent_ifAbsent_("buy",(function(value){
|
1078
|
+
return smalltalk.withContext(function($ctx2) {
|
872
1079
|
return visited;
|
873
|
-
}),(function(){
|
874
|
-
|
1080
|
+
}, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}),(function(){
|
1081
|
+
return smalltalk.withContext(function($ctx2) {
|
875
1082
|
return visited;
|
876
|
-
})
|
877
|
-
|
878
|
-
return self}
|
1083
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
1084
|
+
_st(self)._assert_(visited);
|
1085
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfPresentIfAbsent",{d:d,visited:visited}, smalltalk.DictionaryTest)})}
|
879
1086
|
}),
|
880
1087
|
smalltalk.DictionaryTest);
|
881
1088
|
|
@@ -886,12 +1093,12 @@ selector: "testKeys",
|
|
886
1093
|
fn: function (){
|
887
1094
|
var self=this;
|
888
1095
|
var d;
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
return self}
|
1096
|
+
return smalltalk.withContext(function($ctx1) {
|
1097
|
+
_st(d)._at_put_((1),(2));
|
1098
|
+
_st(d)._at_put_((2),(3));
|
1099
|
+
_st(d)._at_put_((3),(4));
|
1100
|
+
_st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
|
1101
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testKeys",{d:d}, smalltalk.DictionaryTest)})}
|
895
1102
|
}),
|
896
1103
|
smalltalk.DictionaryTest);
|
897
1104
|
|
@@ -901,13 +1108,13 @@ smalltalk.method({
|
|
901
1108
|
selector: "testPrintString",
|
902
1109
|
fn: function (){
|
903
1110
|
var self=this;
|
904
|
-
|
905
|
-
$1=
|
906
|
-
|
907
|
-
|
908
|
-
$2=
|
909
|
-
|
910
|
-
return self}
|
1111
|
+
return smalltalk.withContext(function($ctx1) {
|
1112
|
+
$1=_st((smalltalk.Dictionary || Dictionary))._new();
|
1113
|
+
_st($1)._at_put_("firstname","James");
|
1114
|
+
_st($1)._at_put_("lastname","Bond");
|
1115
|
+
$2=_st($1)._printString();
|
1116
|
+
_st(self)._assert_equals_("a Dictionary('firstname'->'James' , 'lastname'->'Bond')",$2);
|
1117
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{}, smalltalk.DictionaryTest)})}
|
911
1118
|
}),
|
912
1119
|
smalltalk.DictionaryTest);
|
913
1120
|
|
@@ -917,19 +1124,18 @@ smalltalk.method({
|
|
917
1124
|
selector: "testRemoveKey",
|
918
1125
|
fn: function (){
|
919
1126
|
var self=this;
|
920
|
-
var d;
|
921
|
-
|
922
|
-
d
|
923
|
-
|
924
|
-
|
925
|
-
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
1127
|
+
var d,key;
|
1128
|
+
return smalltalk.withContext(function($ctx1) {
|
1129
|
+
_st(d)._at_put_((1),(2));
|
1130
|
+
_st(d)._at_put_((2),(3));
|
1131
|
+
_st(d)._at_put_((3),(4));
|
926
1132
|
key=(2);
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
return self}
|
1133
|
+
_st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (2), (3)]));
|
1134
|
+
_st(d)._removeKey_(key);
|
1135
|
+
_st(self)._assert_(_st(_st(d)._keys()).__eq([(1), (3)]));
|
1136
|
+
_st(self)._assert_(_st(_st(d)._values()).__eq([(2), (4)]));
|
1137
|
+
_st(self)._deny_(_st(d)._includesKey_((2)));
|
1138
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKey",{d:d,key:key}, smalltalk.DictionaryTest)})}
|
933
1139
|
}),
|
934
1140
|
smalltalk.DictionaryTest);
|
935
1141
|
|
@@ -939,23 +1145,22 @@ smalltalk.method({
|
|
939
1145
|
selector: "testRemoveKeyIfAbsent",
|
940
1146
|
fn: function (){
|
941
1147
|
var self=this;
|
942
|
-
var d;
|
943
|
-
|
944
|
-
d
|
945
|
-
|
946
|
-
|
947
|
-
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
1148
|
+
var d,key;
|
1149
|
+
return smalltalk.withContext(function($ctx1) {
|
1150
|
+
_st(d)._at_put_((1),(2));
|
1151
|
+
_st(d)._at_put_((2),(3));
|
1152
|
+
_st(d)._at_put_((3),(4));
|
948
1153
|
key=(2);
|
949
|
-
|
1154
|
+
_st(self)._assert_(_st(_st(d)._removeKey_(key)).__eq((3)));
|
950
1155
|
key=(3);
|
951
|
-
|
952
|
-
return (
|
953
|
-
})
|
1156
|
+
_st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
|
1157
|
+
return smalltalk.withContext(function($ctx2) {
|
1158
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq((4)));
|
954
1159
|
key="why";
|
955
|
-
|
956
|
-
return (
|
957
|
-
})
|
958
|
-
return self}
|
1160
|
+
_st(self)._assert_(_st(_st(d)._removeKey_ifAbsent_(key,(function(){
|
1161
|
+
return smalltalk.withContext(function($ctx2) {
|
1162
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq((42)));
|
1163
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testRemoveKeyIfAbsent",{d:d,key:key}, smalltalk.DictionaryTest)})}
|
959
1164
|
}),
|
960
1165
|
smalltalk.DictionaryTest);
|
961
1166
|
|
@@ -966,13 +1171,13 @@ selector: "testSize",
|
|
966
1171
|
fn: function (){
|
967
1172
|
var self=this;
|
968
1173
|
var d;
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
return self}
|
1174
|
+
return smalltalk.withContext(function($ctx1) {
|
1175
|
+
_st(self)._assert_(_st(_st(d)._size()).__eq((0)));
|
1176
|
+
_st(d)._at_put_((1),(2));
|
1177
|
+
_st(self)._assert_(_st(_st(d)._size()).__eq((1)));
|
1178
|
+
_st(d)._at_put_((2),(3));
|
1179
|
+
_st(self)._assert_(_st(_st(d)._size()).__eq((2)));
|
1180
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSize",{d:d}, smalltalk.DictionaryTest)})}
|
976
1181
|
}),
|
977
1182
|
smalltalk.DictionaryTest);
|
978
1183
|
|
@@ -983,12 +1188,12 @@ selector: "testValues",
|
|
983
1188
|
fn: function (){
|
984
1189
|
var self=this;
|
985
1190
|
var d;
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
return self}
|
1191
|
+
return smalltalk.withContext(function($ctx1) {
|
1192
|
+
_st(d)._at_put_((1),(2));
|
1193
|
+
_st(d)._at_put_((2),(3));
|
1194
|
+
_st(d)._at_put_((3),(4));
|
1195
|
+
_st(self)._assert_(_st(_st(d)._values()).__eq([(2), (3), (4)]));
|
1196
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testValues",{d:d}, smalltalk.DictionaryTest)})}
|
992
1197
|
}),
|
993
1198
|
smalltalk.DictionaryTest);
|
994
1199
|
|
@@ -999,8 +1204,10 @@ smalltalk.method({
|
|
999
1204
|
selector: "collectionClass",
|
1000
1205
|
fn: function (){
|
1001
1206
|
var self=this;
|
1002
|
-
return
|
1003
|
-
|
1207
|
+
return smalltalk.withContext(function($ctx1) {
|
1208
|
+
$1=(smalltalk.Dictionary || Dictionary);
|
1209
|
+
return $1;
|
1210
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.DictionaryTest.klass)})}
|
1004
1211
|
}),
|
1005
1212
|
smalltalk.DictionaryTest.klass);
|
1006
1213
|
|
@@ -1012,11 +1219,11 @@ smalltalk.method({
|
|
1012
1219
|
selector: "testAt",
|
1013
1220
|
fn: function (){
|
1014
1221
|
var self=this;
|
1015
|
-
smalltalk.
|
1016
|
-
|
1017
|
-
return smalltalk.
|
1018
|
-
}),(smalltalk.Error || Error)
|
1019
|
-
return self}
|
1222
|
+
return smalltalk.withContext(function($ctx1) {
|
1223
|
+
_st(self)._should_raise_((function(){
|
1224
|
+
return smalltalk.withContext(function($ctx2) {
|
1225
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1226
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SequenceableCollectionTest)})}
|
1020
1227
|
}),
|
1021
1228
|
smalltalk.SequenceableCollectionTest);
|
1022
1229
|
|
@@ -1026,10 +1233,10 @@ smalltalk.method({
|
|
1026
1233
|
selector: "testAtIfAbsent",
|
1027
1234
|
fn: function (){
|
1028
1235
|
var self=this;
|
1029
|
-
smalltalk.
|
1030
|
-
return
|
1031
|
-
})
|
1032
|
-
return self}
|
1236
|
+
return smalltalk.withContext(function($ctx1) {
|
1237
|
+
return smalltalk.withContext(function($ctx2) {
|
1238
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq("none"));
|
1239
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{}, smalltalk.SequenceableCollectionTest)})}
|
1033
1240
|
}),
|
1034
1241
|
smalltalk.SequenceableCollectionTest);
|
1035
1242
|
|
@@ -1043,22 +1250,22 @@ selector: "testAtIfAbsent",
|
|
1043
1250
|
fn: function (){
|
1044
1251
|
var self=this;
|
1045
1252
|
var array;
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
return
|
1051
|
-
})
|
1052
|
-
|
1053
|
-
return
|
1054
|
-
})
|
1055
|
-
|
1056
|
-
return
|
1057
|
-
})
|
1058
|
-
|
1059
|
-
return
|
1060
|
-
})
|
1061
|
-
return self}
|
1253
|
+
return smalltalk.withContext(function($ctx1) {
|
1254
|
+
_st(self)._assert_equals_(_st(array)._at_((1)),"hello");
|
1255
|
+
_st(self)._assert_equals_(_st(array)._at_((2)),"world");
|
1256
|
+
_st(self)._assert_equals_(_st(array)._at_ifAbsent_((2),(function(){
|
1257
|
+
return smalltalk.withContext(function($ctx2) {
|
1258
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"world");
|
1259
|
+
_st(self)._assert_equals_(_st(array)._at_ifAbsent_((0),(function(){
|
1260
|
+
return smalltalk.withContext(function($ctx2) {
|
1261
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
|
1262
|
+
_st(self)._assert_equals_(_st(array)._at_ifAbsent_((-10),(function(){
|
1263
|
+
return smalltalk.withContext(function($ctx2) {
|
1264
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
|
1265
|
+
_st(self)._assert_equals_(_st(array)._at_ifAbsent_((3),(function(){
|
1266
|
+
return smalltalk.withContext(function($ctx2) {
|
1267
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"not found");
|
1268
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{array:array}, smalltalk.ArrayTest)})}
|
1062
1269
|
}),
|
1063
1270
|
smalltalk.ArrayTest);
|
1064
1271
|
|
@@ -1068,8 +1275,8 @@ smalltalk.method({
|
|
1068
1275
|
selector: "testFirstN",
|
1069
1276
|
fn: function (){
|
1070
1277
|
var self=this;
|
1071
|
-
smalltalk.
|
1072
|
-
return self}
|
1278
|
+
return smalltalk.withContext(function($ctx1) {
|
1279
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testFirstN",{}, smalltalk.ArrayTest)})}
|
1073
1280
|
}),
|
1074
1281
|
smalltalk.ArrayTest);
|
1075
1282
|
|
@@ -1079,10 +1286,10 @@ smalltalk.method({
|
|
1079
1286
|
selector: "testIfEmpty",
|
1080
1287
|
fn: function (){
|
1081
1288
|
var self=this;
|
1082
|
-
smalltalk.
|
1083
|
-
return
|
1084
|
-
})
|
1085
|
-
return self}
|
1289
|
+
return smalltalk.withContext(function($ctx1) {
|
1290
|
+
return smalltalk.withContext(function($ctx2) {
|
1291
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
1292
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfEmpty",{}, smalltalk.ArrayTest)})}
|
1086
1293
|
}),
|
1087
1294
|
smalltalk.ArrayTest);
|
1088
1295
|
|
@@ -1092,23 +1299,25 @@ smalltalk.method({
|
|
1092
1299
|
selector: "testPrintString",
|
1093
1300
|
fn: function (){
|
1094
1301
|
var self=this;
|
1095
|
-
var $1,$2;
|
1096
1302
|
var array;
|
1097
|
-
|
1098
|
-
smalltalk.
|
1099
|
-
|
1100
|
-
$1=
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1303
|
+
return smalltalk.withContext(function($ctx1) {
|
1304
|
+
array=_st((smalltalk.Array || Array))._new();
|
1305
|
+
_st(self)._assert_equals_("a Array ()",_st(array)._printString());
|
1306
|
+
$1=array;
|
1307
|
+
_st($1)._add_((1));
|
1308
|
+
$2=_st($1)._add_((3));
|
1309
|
+
_st(self)._assert_equals_("a Array (1 3)",_st(array)._printString());
|
1310
|
+
_st(array)._add_("foo");
|
1311
|
+
_st(self)._assert_equals_("a Array (1 3 'foo')",_st(array)._printString());
|
1312
|
+
$3=array;
|
1313
|
+
_st($3)._remove_((1));
|
1314
|
+
$4=_st($3)._remove_((3));
|
1315
|
+
_st(self)._assert_equals_("a Array ('foo')",_st(array)._printString());
|
1316
|
+
_st(array)._addLast_((3));
|
1317
|
+
_st(self)._assert_equals_("a Array ('foo' 3)",_st(array)._printString());
|
1318
|
+
_st(array)._addLast_((3));
|
1319
|
+
_st(self)._assert_equals_("a Array ('foo' 3 3)",_st(array)._printString());
|
1320
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{array:array}, smalltalk.ArrayTest)})}
|
1112
1321
|
}),
|
1113
1322
|
smalltalk.ArrayTest);
|
1114
1323
|
|
@@ -1119,8 +1328,10 @@ smalltalk.method({
|
|
1119
1328
|
selector: "collectionClass",
|
1120
1329
|
fn: function (){
|
1121
1330
|
var self=this;
|
1122
|
-
return
|
1123
|
-
|
1331
|
+
return smalltalk.withContext(function($ctx1) {
|
1332
|
+
$1=(smalltalk.Array || Array);
|
1333
|
+
return $1;
|
1334
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.ArrayTest.klass)})}
|
1124
1335
|
}),
|
1125
1336
|
smalltalk.ArrayTest.klass);
|
1126
1337
|
|
@@ -1132,8 +1343,8 @@ smalltalk.method({
|
|
1132
1343
|
selector: "collection",
|
1133
1344
|
fn: function (){
|
1134
1345
|
var self=this;
|
1135
|
-
return
|
1136
|
-
}
|
1346
|
+
return smalltalk.withContext(function($ctx1) {
|
1347
|
+
}, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.StringTest)})}
|
1137
1348
|
}),
|
1138
1349
|
smalltalk.StringTest);
|
1139
1350
|
|
@@ -1143,8 +1354,8 @@ smalltalk.method({
|
|
1143
1354
|
selector: "collectionWithDuplicates",
|
1144
1355
|
fn: function (){
|
1145
1356
|
var self=this;
|
1146
|
-
return
|
1147
|
-
}
|
1357
|
+
return smalltalk.withContext(function($ctx1) {
|
1358
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.StringTest)})}
|
1148
1359
|
}),
|
1149
1360
|
smalltalk.StringTest);
|
1150
1361
|
|
@@ -1154,13 +1365,13 @@ smalltalk.method({
|
|
1154
1365
|
selector: "testAddRemove",
|
1155
1366
|
fn: function (){
|
1156
1367
|
var self=this;
|
1157
|
-
smalltalk.
|
1158
|
-
return smalltalk.
|
1159
|
-
}),(smalltalk.Error || Error)
|
1160
|
-
|
1161
|
-
return smalltalk.
|
1162
|
-
}),(smalltalk.Error || Error)
|
1163
|
-
return self}
|
1368
|
+
return smalltalk.withContext(function($ctx1) {
|
1369
|
+
return smalltalk.withContext(function($ctx2) {
|
1370
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1371
|
+
_st(self)._should_raise_((function(){
|
1372
|
+
return smalltalk.withContext(function($ctx2) {
|
1373
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1374
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{}, smalltalk.StringTest)})}
|
1164
1375
|
}),
|
1165
1376
|
smalltalk.StringTest);
|
1166
1377
|
|
@@ -1170,8 +1381,8 @@ smalltalk.method({
|
|
1170
1381
|
selector: "testAsArray",
|
1171
1382
|
fn: function (){
|
1172
1383
|
var self=this;
|
1173
|
-
smalltalk.
|
1174
|
-
return self}
|
1384
|
+
return smalltalk.withContext(function($ctx1) {
|
1385
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsArray",{}, smalltalk.StringTest)})}
|
1175
1386
|
}),
|
1176
1387
|
smalltalk.StringTest);
|
1177
1388
|
|
@@ -1181,12 +1392,12 @@ smalltalk.method({
|
|
1181
1392
|
selector: "testAt",
|
1182
1393
|
fn: function (){
|
1183
1394
|
var self=this;
|
1184
|
-
smalltalk.
|
1185
|
-
|
1186
|
-
|
1187
|
-
return
|
1188
|
-
})
|
1189
|
-
return self}
|
1395
|
+
return smalltalk.withContext(function($ctx1) {
|
1396
|
+
_st(self)._assert_(_st(_st("hello")._at_((5))).__eq("o"));
|
1397
|
+
_st(self)._assert_(_st(_st("hello")._at_ifAbsent_((6),(function(){
|
1398
|
+
return smalltalk.withContext(function($ctx2) {
|
1399
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(nil));
|
1400
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.StringTest)})}
|
1190
1401
|
}),
|
1191
1402
|
smalltalk.StringTest);
|
1192
1403
|
|
@@ -1196,10 +1407,10 @@ smalltalk.method({
|
|
1196
1407
|
selector: "testAtPut",
|
1197
1408
|
fn: function (){
|
1198
1409
|
var self=this;
|
1199
|
-
smalltalk.
|
1200
|
-
return smalltalk.
|
1201
|
-
}),(smalltalk.Error || Error)
|
1202
|
-
return self}
|
1410
|
+
return smalltalk.withContext(function($ctx1) {
|
1411
|
+
return smalltalk.withContext(function($ctx2) {
|
1412
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1413
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{}, smalltalk.StringTest)})}
|
1203
1414
|
}),
|
1204
1415
|
smalltalk.StringTest);
|
1205
1416
|
|
@@ -1210,11 +1421,11 @@ selector: "testCollect",
|
|
1210
1421
|
fn: function (){
|
1211
1422
|
var self=this;
|
1212
1423
|
var newCollection;
|
1213
|
-
|
1214
|
-
|
1215
|
-
return smalltalk.
|
1216
|
-
})
|
1217
|
-
return self}
|
1424
|
+
return smalltalk.withContext(function($ctx1) {
|
1425
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
|
1426
|
+
return smalltalk.withContext(function($ctx2) {
|
1427
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
1428
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.StringTest)})}
|
1218
1429
|
}),
|
1219
1430
|
smalltalk.StringTest);
|
1220
1431
|
|
@@ -1224,8 +1435,8 @@ smalltalk.method({
|
|
1224
1435
|
selector: "testCopyWithoutAll",
|
1225
1436
|
fn: function (){
|
1226
1437
|
var self=this;
|
1227
|
-
|
1228
|
-
return self}
|
1438
|
+
return smalltalk.withContext(function($ctx1) {
|
1439
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCopyWithoutAll",{}, smalltalk.StringTest)})}
|
1229
1440
|
}),
|
1230
1441
|
smalltalk.StringTest);
|
1231
1442
|
|
@@ -1235,15 +1446,15 @@ smalltalk.method({
|
|
1235
1446
|
selector: "testDetect",
|
1236
1447
|
fn: function (){
|
1237
1448
|
var self=this;
|
1238
|
-
smalltalk.
|
1239
|
-
return smalltalk.
|
1240
|
-
})
|
1241
|
-
|
1242
|
-
return smalltalk.
|
1243
|
-
return smalltalk.
|
1244
|
-
})
|
1245
|
-
}),(smalltalk.Error || Error)
|
1246
|
-
return self}
|
1449
|
+
return smalltalk.withContext(function($ctx1) {
|
1450
|
+
return smalltalk.withContext(function($ctx2) {
|
1451
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq("h"));
|
1452
|
+
_st(self)._should_raise_((function(){
|
1453
|
+
return smalltalk.withContext(function($ctx2) {
|
1454
|
+
return smalltalk.withContext(function($ctx3) {
|
1455
|
+
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
|
1456
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1457
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.StringTest)})}
|
1247
1458
|
}),
|
1248
1459
|
smalltalk.StringTest);
|
1249
1460
|
|
@@ -1253,12 +1464,12 @@ smalltalk.method({
|
|
1253
1464
|
selector: "testEquality",
|
1254
1465
|
fn: function (){
|
1255
1466
|
var self=this;
|
1256
|
-
smalltalk.
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
return self}
|
1467
|
+
return smalltalk.withContext(function($ctx1) {
|
1468
|
+
_st(self)._deny_(_st("hello").__eq("world"));
|
1469
|
+
_st(self)._assert_(_st("hello").__eq(_st("hello")._yourself()));
|
1470
|
+
_st(self)._assert_(_st(_st("hello")._yourself()).__eq("hello"));
|
1471
|
+
_st(self)._deny_(_st("").__eq((0)));
|
1472
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.StringTest)})}
|
1262
1473
|
}),
|
1263
1474
|
smalltalk.StringTest);
|
1264
1475
|
|
@@ -1268,12 +1479,12 @@ smalltalk.method({
|
|
1268
1479
|
selector: "testIdentity",
|
1269
1480
|
fn: function (){
|
1270
1481
|
var self=this;
|
1271
|
-
smalltalk.
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
return self}
|
1482
|
+
return smalltalk.withContext(function($ctx1) {
|
1483
|
+
_st(self)._deny_(_st("hello").__eq_eq("world"));
|
1484
|
+
_st(self)._assert_(_st("hello").__eq_eq(_st("hello")._yourself()));
|
1485
|
+
_st(self)._assert_(_st(_st("hello")._yourself()).__eq_eq("hello"));
|
1486
|
+
_st(self)._deny_(_st("").__eq_eq((0)));
|
1487
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.StringTest)})}
|
1277
1488
|
}),
|
1278
1489
|
smalltalk.StringTest);
|
1279
1490
|
|
@@ -1283,9 +1494,9 @@ smalltalk.method({
|
|
1283
1494
|
selector: "testIncludesSubString",
|
1284
1495
|
fn: function (){
|
1285
1496
|
var self=this;
|
1286
|
-
smalltalk.
|
1287
|
-
|
1288
|
-
return self}
|
1497
|
+
return smalltalk.withContext(function($ctx1) {
|
1498
|
+
_st(self)._deny_(_st("amber")._includesSubString_("zork"));
|
1499
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIncludesSubString",{}, smalltalk.StringTest)})}
|
1289
1500
|
}),
|
1290
1501
|
smalltalk.StringTest);
|
1291
1502
|
|
@@ -1295,8 +1506,8 @@ smalltalk.method({
|
|
1295
1506
|
selector: "testJoin",
|
1296
1507
|
fn: function (){
|
1297
1508
|
var self=this;
|
1298
|
-
smalltalk.
|
1299
|
-
return self}
|
1509
|
+
return smalltalk.withContext(function($ctx1) {
|
1510
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testJoin",{}, smalltalk.StringTest)})}
|
1300
1511
|
}),
|
1301
1512
|
smalltalk.StringTest);
|
1302
1513
|
|
@@ -1307,11 +1518,11 @@ selector: "testSelect",
|
|
1307
1518
|
fn: function (){
|
1308
1519
|
var self=this;
|
1309
1520
|
var newCollection;
|
1310
|
-
|
1311
|
-
|
1312
|
-
return smalltalk.
|
1313
|
-
})
|
1314
|
-
return self}
|
1521
|
+
return smalltalk.withContext(function($ctx1) {
|
1522
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
|
1523
|
+
return smalltalk.withContext(function($ctx2) {
|
1524
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
1525
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.StringTest)})}
|
1315
1526
|
}),
|
1316
1527
|
smalltalk.StringTest);
|
1317
1528
|
|
@@ -1321,9 +1532,9 @@ smalltalk.method({
|
|
1321
1532
|
selector: "testSize",
|
1322
1533
|
fn: function (){
|
1323
1534
|
var self=this;
|
1324
|
-
smalltalk.
|
1325
|
-
|
1326
|
-
return self}
|
1535
|
+
return smalltalk.withContext(function($ctx1) {
|
1536
|
+
_st(self)._assert_equals_(_st("")._size(),(0));
|
1537
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.StringTest)})}
|
1327
1538
|
}),
|
1328
1539
|
smalltalk.StringTest);
|
1329
1540
|
|
@@ -1333,14 +1544,15 @@ smalltalk.method({
|
|
1333
1544
|
selector: "testStreamContents",
|
1334
1545
|
fn: function (){
|
1335
1546
|
var self=this;
|
1336
|
-
|
1337
|
-
|
1338
|
-
smalltalk.
|
1339
|
-
|
1340
|
-
$1
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1547
|
+
return smalltalk.withContext(function($ctx1) {
|
1548
|
+
_st(self)._assert_equals_("hello world",_st((smalltalk.String || String))._streamContents_((function(aStream){
|
1549
|
+
return smalltalk.withContext(function($ctx2) {
|
1550
|
+
_st($1)._nextPutAll_("hello");
|
1551
|
+
_st($1)._space();
|
1552
|
+
$2=_st($1)._nextPutAll_("world");
|
1553
|
+
return $2;
|
1554
|
+
}, function($ctx2) {$ctx2.fillBlock({aStream:aStream},$ctx1)})})));
|
1555
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testStreamContents",{}, smalltalk.StringTest)})}
|
1344
1556
|
}),
|
1345
1557
|
smalltalk.StringTest);
|
1346
1558
|
|
@@ -1351,8 +1563,10 @@ smalltalk.method({
|
|
1351
1563
|
selector: "collectionClass",
|
1352
1564
|
fn: function (){
|
1353
1565
|
var self=this;
|
1354
|
-
return
|
1355
|
-
|
1566
|
+
return smalltalk.withContext(function($ctx1) {
|
1567
|
+
$1=(smalltalk.String || String);
|
1568
|
+
return $1;
|
1569
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.StringTest.klass)})}
|
1356
1570
|
}),
|
1357
1571
|
smalltalk.StringTest.klass);
|
1358
1572
|
|
@@ -1364,8 +1578,8 @@ smalltalk.method({
|
|
1364
1578
|
selector: "collection",
|
1365
1579
|
fn: function (){
|
1366
1580
|
var self=this;
|
1367
|
-
return smalltalk.
|
1368
|
-
}
|
1581
|
+
return smalltalk.withContext(function($ctx1) {
|
1582
|
+
}, function($ctx1) {$ctx1.fill(self,"collection",{}, smalltalk.SymbolTest)})}
|
1369
1583
|
}),
|
1370
1584
|
smalltalk.SymbolTest);
|
1371
1585
|
|
@@ -1375,8 +1589,8 @@ smalltalk.method({
|
|
1375
1589
|
selector: "collectionWithDuplicates",
|
1376
1590
|
fn: function (){
|
1377
1591
|
var self=this;
|
1378
|
-
return smalltalk.
|
1379
|
-
}
|
1592
|
+
return smalltalk.withContext(function($ctx1) {
|
1593
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{}, smalltalk.SymbolTest)})}
|
1380
1594
|
}),
|
1381
1595
|
smalltalk.SymbolTest);
|
1382
1596
|
|
@@ -1386,8 +1600,8 @@ smalltalk.method({
|
|
1386
1600
|
selector: "testAsString",
|
1387
1601
|
fn: function (){
|
1388
1602
|
var self=this;
|
1389
|
-
smalltalk.
|
1390
|
-
return self}
|
1603
|
+
return smalltalk.withContext(function($ctx1) {
|
1604
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsString",{}, smalltalk.SymbolTest)})}
|
1391
1605
|
}),
|
1392
1606
|
smalltalk.SymbolTest);
|
1393
1607
|
|
@@ -1397,8 +1611,8 @@ smalltalk.method({
|
|
1397
1611
|
selector: "testAsSymbol",
|
1398
1612
|
fn: function (){
|
1399
1613
|
var self=this;
|
1400
|
-
smalltalk.
|
1401
|
-
return self}
|
1614
|
+
return smalltalk.withContext(function($ctx1) {
|
1615
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAsSymbol",{}, smalltalk.SymbolTest)})}
|
1402
1616
|
}),
|
1403
1617
|
smalltalk.SymbolTest);
|
1404
1618
|
|
@@ -1408,12 +1622,12 @@ smalltalk.method({
|
|
1408
1622
|
selector: "testAt",
|
1409
1623
|
fn: function (){
|
1410
1624
|
var self=this;
|
1411
|
-
smalltalk.
|
1412
|
-
|
1413
|
-
|
1414
|
-
return
|
1415
|
-
})
|
1416
|
-
return self}
|
1625
|
+
return smalltalk.withContext(function($ctx1) {
|
1626
|
+
_st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_((5))).__eq("o"));
|
1627
|
+
_st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._at_ifAbsent_((6),(function(){
|
1628
|
+
return smalltalk.withContext(function($ctx2) {
|
1629
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(nil));
|
1630
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SymbolTest)})}
|
1417
1631
|
}),
|
1418
1632
|
smalltalk.SymbolTest);
|
1419
1633
|
|
@@ -1423,10 +1637,10 @@ smalltalk.method({
|
|
1423
1637
|
selector: "testAtPut",
|
1424
1638
|
fn: function (){
|
1425
1639
|
var self=this;
|
1426
|
-
smalltalk.
|
1427
|
-
return smalltalk.
|
1428
|
-
}),(smalltalk.Error || Error)
|
1429
|
-
return self}
|
1640
|
+
return smalltalk.withContext(function($ctx1) {
|
1641
|
+
return smalltalk.withContext(function($ctx2) {
|
1642
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1643
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{}, smalltalk.SymbolTest)})}
|
1430
1644
|
}),
|
1431
1645
|
smalltalk.SymbolTest);
|
1432
1646
|
|
@@ -1437,11 +1651,11 @@ selector: "testCollect",
|
|
1437
1651
|
fn: function (){
|
1438
1652
|
var self=this;
|
1439
1653
|
var newCollection;
|
1440
|
-
|
1441
|
-
|
1442
|
-
return smalltalk.
|
1443
|
-
})
|
1444
|
-
return self}
|
1654
|
+
return smalltalk.withContext(function($ctx1) {
|
1655
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._collect_((function(each){
|
1656
|
+
return smalltalk.withContext(function($ctx2) {
|
1657
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
1658
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCollect",{newCollection:newCollection}, smalltalk.SymbolTest)})}
|
1445
1659
|
}),
|
1446
1660
|
smalltalk.SymbolTest);
|
1447
1661
|
|
@@ -1451,15 +1665,15 @@ smalltalk.method({
|
|
1451
1665
|
selector: "testComparing",
|
1452
1666
|
fn: function (){
|
1453
1667
|
var self=this;
|
1454
|
-
smalltalk.
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
return self}
|
1668
|
+
return smalltalk.withContext(function($ctx1) {
|
1669
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt(smalltalk.symbolFor("ba")));
|
1670
|
+
_st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt(smalltalk.symbolFor("ba")));
|
1671
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt(smalltalk.symbolFor("ba")));
|
1672
|
+
_st(self)._assert_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("aa")));
|
1673
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("ab")).__gt_eq(smalltalk.symbolFor("ba")));
|
1674
|
+
_st(self)._assert_(_st(smalltalk.symbolFor("ab")).__lt_eq(smalltalk.symbolFor("ba")));
|
1675
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("bb")).__lt_eq(smalltalk.symbolFor("ba")));
|
1676
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testComparing",{}, smalltalk.SymbolTest)})}
|
1463
1677
|
}),
|
1464
1678
|
smalltalk.SymbolTest);
|
1465
1679
|
|
@@ -1469,9 +1683,9 @@ smalltalk.method({
|
|
1469
1683
|
selector: "testCopying",
|
1470
1684
|
fn: function (){
|
1471
1685
|
var self=this;
|
1472
|
-
smalltalk.
|
1473
|
-
|
1474
|
-
return self}
|
1686
|
+
return smalltalk.withContext(function($ctx1) {
|
1687
|
+
_st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._deepCopy()).__eq_eq(smalltalk.symbolFor("hello")));
|
1688
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.SymbolTest)})}
|
1475
1689
|
}),
|
1476
1690
|
smalltalk.SymbolTest);
|
1477
1691
|
|
@@ -1481,15 +1695,15 @@ smalltalk.method({
|
|
1481
1695
|
selector: "testDetect",
|
1482
1696
|
fn: function (){
|
1483
1697
|
var self=this;
|
1484
|
-
smalltalk.
|
1485
|
-
return smalltalk.
|
1486
|
-
})
|
1487
|
-
|
1488
|
-
return smalltalk.
|
1489
|
-
return smalltalk.
|
1490
|
-
})
|
1491
|
-
}),(smalltalk.Error || Error)
|
1492
|
-
return self}
|
1698
|
+
return smalltalk.withContext(function($ctx1) {
|
1699
|
+
return smalltalk.withContext(function($ctx2) {
|
1700
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}))).__eq("h"));
|
1701
|
+
_st(self)._should_raise_((function(){
|
1702
|
+
return smalltalk.withContext(function($ctx2) {
|
1703
|
+
return smalltalk.withContext(function($ctx3) {
|
1704
|
+
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
|
1705
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
1706
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDetect",{}, smalltalk.SymbolTest)})}
|
1493
1707
|
}),
|
1494
1708
|
smalltalk.SymbolTest);
|
1495
1709
|
|
@@ -1499,13 +1713,13 @@ smalltalk.method({
|
|
1499
1713
|
selector: "testEquality",
|
1500
1714
|
fn: function (){
|
1501
1715
|
var self=this;
|
1502
|
-
smalltalk.
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
return self}
|
1716
|
+
return smalltalk.withContext(function($ctx1) {
|
1717
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq(smalltalk.symbolFor("world")));
|
1718
|
+
_st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
|
1719
|
+
_st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(smalltalk.symbolFor("hello")));
|
1720
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq("hello"));
|
1721
|
+
_st(self)._deny_(_st("hello").__eq(smalltalk.symbolFor("hello")));
|
1722
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.SymbolTest)})}
|
1509
1723
|
}),
|
1510
1724
|
smalltalk.SymbolTest);
|
1511
1725
|
|
@@ -1515,11 +1729,11 @@ smalltalk.method({
|
|
1515
1729
|
selector: "testIdentity",
|
1516
1730
|
fn: function (){
|
1517
1731
|
var self=this;
|
1518
|
-
smalltalk.
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
return self}
|
1732
|
+
return smalltalk.withContext(function($ctx1) {
|
1733
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("hello")).__eq_eq(smalltalk.symbolFor("world")));
|
1734
|
+
_st(self)._assert_(_st(smalltalk.symbolFor("hello")).__eq(_st(smalltalk.symbolFor("hello"))._yourself()));
|
1735
|
+
_st(self)._assert_(_st(_st(smalltalk.symbolFor("hello"))._yourself()).__eq(_st(_st(smalltalk.symbolFor("hello"))._asString())._asSymbol()));
|
1736
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.SymbolTest)})}
|
1523
1737
|
}),
|
1524
1738
|
smalltalk.SymbolTest);
|
1525
1739
|
|
@@ -1529,9 +1743,9 @@ smalltalk.method({
|
|
1529
1743
|
selector: "testIsEmpty",
|
1530
1744
|
fn: function (){
|
1531
1745
|
var self=this;
|
1532
|
-
smalltalk.
|
1533
|
-
|
1534
|
-
return self}
|
1746
|
+
return smalltalk.withContext(function($ctx1) {
|
1747
|
+
_st(self)._assert_(_st(_st("")._asSymbol())._isEmpty());
|
1748
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIsEmpty",{}, smalltalk.SymbolTest)})}
|
1535
1749
|
}),
|
1536
1750
|
smalltalk.SymbolTest);
|
1537
1751
|
|
@@ -1541,11 +1755,11 @@ smalltalk.method({
|
|
1541
1755
|
selector: "testIsSymbolIsString",
|
1542
1756
|
fn: function (){
|
1543
1757
|
var self=this;
|
1544
|
-
smalltalk.
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
return self}
|
1758
|
+
return smalltalk.withContext(function($ctx1) {
|
1759
|
+
_st(self)._deny_(_st("hello")._isSymbol());
|
1760
|
+
_st(self)._deny_(_st(smalltalk.symbolFor("hello"))._isString());
|
1761
|
+
_st(self)._assert_(_st("hello")._isString());
|
1762
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIsSymbolIsString",{}, smalltalk.SymbolTest)})}
|
1549
1763
|
}),
|
1550
1764
|
smalltalk.SymbolTest);
|
1551
1765
|
|
@@ -1556,11 +1770,11 @@ selector: "testSelect",
|
|
1556
1770
|
fn: function (){
|
1557
1771
|
var self=this;
|
1558
1772
|
var newCollection;
|
1559
|
-
|
1560
|
-
|
1561
|
-
return smalltalk.
|
1562
|
-
})
|
1563
|
-
return self}
|
1773
|
+
return smalltalk.withContext(function($ctx1) {
|
1774
|
+
_st(self)._assertSameContents_as_(_st(_st(self)._collection())._select_((function(each){
|
1775
|
+
return smalltalk.withContext(function($ctx2) {
|
1776
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})),newCollection);
|
1777
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSelect",{newCollection:newCollection}, smalltalk.SymbolTest)})}
|
1564
1778
|
}),
|
1565
1779
|
smalltalk.SymbolTest);
|
1566
1780
|
|
@@ -1570,9 +1784,9 @@ smalltalk.method({
|
|
1570
1784
|
selector: "testSize",
|
1571
1785
|
fn: function (){
|
1572
1786
|
var self=this;
|
1573
|
-
smalltalk.
|
1574
|
-
|
1575
|
-
return self}
|
1787
|
+
return smalltalk.withContext(function($ctx1) {
|
1788
|
+
_st(self)._assert_equals_(_st(smalltalk.symbolFor("aaaaa"))._size(),(5));
|
1789
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.SymbolTest)})}
|
1576
1790
|
}),
|
1577
1791
|
smalltalk.SymbolTest);
|
1578
1792
|
|
@@ -1583,8 +1797,10 @@ smalltalk.method({
|
|
1583
1797
|
selector: "collectionClass",
|
1584
1798
|
fn: function (){
|
1585
1799
|
var self=this;
|
1586
|
-
return
|
1587
|
-
|
1800
|
+
return smalltalk.withContext(function($ctx1) {
|
1801
|
+
$1=(smalltalk.Symbol || Symbol);
|
1802
|
+
return $1;
|
1803
|
+
}, function($ctx1) {$ctx1.fill(self,"collectionClass",{}, smalltalk.SymbolTest.klass)})}
|
1588
1804
|
}),
|
1589
1805
|
smalltalk.SymbolTest.klass);
|
1590
1806
|
|
@@ -1596,9 +1812,8 @@ smalltalk.method({
|
|
1596
1812
|
selector: "jsObject",
|
1597
1813
|
fn: function (){
|
1598
1814
|
var self=this;
|
1599
|
-
return
|
1600
|
-
|
1601
|
-
return self}
|
1815
|
+
return smalltalk.withContext(function($ctx1) {
|
1816
|
+
return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{}, smalltalk.JSObjectProxyTest)})}
|
1602
1817
|
}),
|
1603
1818
|
smalltalk.JSObjectProxyTest);
|
1604
1819
|
|
@@ -1608,10 +1823,10 @@ smalltalk.method({
|
|
1608
1823
|
selector: "testDNU",
|
1609
1824
|
fn: function (){
|
1610
1825
|
var self=this;
|
1611
|
-
smalltalk.
|
1612
|
-
return smalltalk.
|
1613
|
-
}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)
|
1614
|
-
return self}
|
1826
|
+
return smalltalk.withContext(function($ctx1) {
|
1827
|
+
return smalltalk.withContext(function($ctx2) {
|
1828
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
1829
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{}, smalltalk.JSObjectProxyTest)})}
|
1615
1830
|
}),
|
1616
1831
|
smalltalk.JSObjectProxyTest);
|
1617
1832
|
|
@@ -1621,10 +1836,10 @@ smalltalk.method({
|
|
1621
1836
|
selector: "testMessageSend",
|
1622
1837
|
fn: function (){
|
1623
1838
|
var self=this;
|
1624
|
-
smalltalk.
|
1625
|
-
|
1626
|
-
|
1627
|
-
return self}
|
1839
|
+
return smalltalk.withContext(function($ctx1) {
|
1840
|
+
_st(self)._assert_equals_(_st(_st(self)._jsObject())._b(),(2));
|
1841
|
+
_st(self)._assert_equals_(_st(_st(self)._jsObject())._c_((3)),(3));
|
1842
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{}, smalltalk.JSObjectProxyTest)})}
|
1628
1843
|
}),
|
1629
1844
|
smalltalk.JSObjectProxyTest);
|
1630
1845
|
|
@@ -1634,8 +1849,8 @@ smalltalk.method({
|
|
1634
1849
|
selector: "testMethodWithArguments",
|
1635
1850
|
fn: function (){
|
1636
1851
|
var self=this;
|
1637
|
-
smalltalk.
|
1638
|
-
return self}
|
1852
|
+
return smalltalk.withContext(function($ctx1) {
|
1853
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testMethodWithArguments",{}, smalltalk.JSObjectProxyTest)})}
|
1639
1854
|
}),
|
1640
1855
|
smalltalk.JSObjectProxyTest);
|
1641
1856
|
|
@@ -1645,8 +1860,8 @@ smalltalk.method({
|
|
1645
1860
|
selector: "testPrinting",
|
1646
1861
|
fn: function (){
|
1647
1862
|
var self=this;
|
1648
|
-
smalltalk.
|
1649
|
-
return self}
|
1863
|
+
return smalltalk.withContext(function($ctx1) {
|
1864
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPrinting",{}, smalltalk.JSObjectProxyTest)})}
|
1650
1865
|
}),
|
1651
1866
|
smalltalk.JSObjectProxyTest);
|
1652
1867
|
|
@@ -1657,11 +1872,27 @@ selector: "testPropertyThatReturnsEmptyString",
|
|
1657
1872
|
fn: function (){
|
1658
1873
|
var self=this;
|
1659
1874
|
var object;
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
return self}
|
1875
|
+
return smalltalk.withContext(function($ctx1) {
|
1876
|
+
_st(self)._assert_equals_("",_st(object)._d());
|
1877
|
+
_st(object)._d_("hello");
|
1878
|
+
_st(self)._assert_equals_("hello",_st(object)._d());
|
1879
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsEmptyString",{object:object}, smalltalk.JSObjectProxyTest)})}
|
1880
|
+
}),
|
1881
|
+
smalltalk.JSObjectProxyTest);
|
1882
|
+
|
1883
|
+
smalltalk.addMethod(
|
1884
|
+
"_testPropertyThatReturnsUndefined",
|
1885
|
+
smalltalk.method({
|
1886
|
+
selector: "testPropertyThatReturnsUndefined",
|
1887
|
+
fn: function (){
|
1888
|
+
var self=this;
|
1889
|
+
var object;
|
1890
|
+
return smalltalk.withContext(function($ctx1) {
|
1891
|
+
_st(self)._shouldnt_raise_((function(){
|
1892
|
+
return smalltalk.withContext(function($ctx2) {
|
1893
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
1894
|
+
_st(self)._assert_(_st(_st(object)._e())._isNil());
|
1895
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPropertyThatReturnsUndefined",{object:object}, smalltalk.JSObjectProxyTest)})}
|
1665
1896
|
}),
|
1666
1897
|
smalltalk.JSObjectProxyTest);
|
1667
1898
|
|
@@ -1671,19 +1902,61 @@ smalltalk.method({
|
|
1671
1902
|
selector: "testYourself",
|
1672
1903
|
fn: function (){
|
1673
1904
|
var self=this;
|
1674
|
-
var $1,$2;
|
1675
1905
|
var object;
|
1676
|
-
|
1677
|
-
|
1678
|
-
$
|
1906
|
+
return smalltalk.withContext(function($ctx1) {
|
1907
|
+
$1=_st(self)._jsObject();
|
1908
|
+
_st($1)._d_("test");
|
1909
|
+
$2=_st($1)._yourself();
|
1679
1910
|
object=$2;
|
1680
|
-
|
1681
|
-
return self}
|
1911
|
+
_st(self)._assert_equals_(_st(object)._d(),"test");
|
1912
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{object:object}, smalltalk.JSObjectProxyTest)})}
|
1682
1913
|
}),
|
1683
1914
|
smalltalk.JSObjectProxyTest);
|
1684
1915
|
|
1685
1916
|
|
1686
1917
|
|
1918
|
+
smalltalk.addClass('JavaScriptExceptionTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1919
|
+
smalltalk.addMethod(
|
1920
|
+
"_testCatchingException",
|
1921
|
+
smalltalk.method({
|
1922
|
+
selector: "testCatchingException",
|
1923
|
+
fn: function (){
|
1924
|
+
var self=this;
|
1925
|
+
return smalltalk.withContext(function($ctx1) {
|
1926
|
+
return smalltalk.withContext(function($ctx2) {
|
1927
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(error){
|
1928
|
+
return smalltalk.withContext(function($ctx2) {
|
1929
|
+
}, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1)})}));
|
1930
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCatchingException",{}, smalltalk.JavaScriptExceptionTest)})}
|
1931
|
+
}),
|
1932
|
+
smalltalk.JavaScriptExceptionTest);
|
1933
|
+
|
1934
|
+
smalltalk.addMethod(
|
1935
|
+
"_testRaisingException",
|
1936
|
+
smalltalk.method({
|
1937
|
+
selector: "testRaisingException",
|
1938
|
+
fn: function (){
|
1939
|
+
var self=this;
|
1940
|
+
return smalltalk.withContext(function($ctx1) {
|
1941
|
+
return smalltalk.withContext(function($ctx2) {
|
1942
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.JavaScriptException || JavaScriptException));
|
1943
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testRaisingException",{}, smalltalk.JavaScriptExceptionTest)})}
|
1944
|
+
}),
|
1945
|
+
smalltalk.JavaScriptExceptionTest);
|
1946
|
+
|
1947
|
+
smalltalk.addMethod(
|
1948
|
+
"_throwException",
|
1949
|
+
smalltalk.method({
|
1950
|
+
selector: "throwException",
|
1951
|
+
fn: function (){
|
1952
|
+
var self=this;
|
1953
|
+
return smalltalk.withContext(function($ctx1) {
|
1954
|
+
return self}, function($ctx1) {$ctx1.fill(self,"throwException",{}, smalltalk.JavaScriptExceptionTest)})}
|
1955
|
+
}),
|
1956
|
+
smalltalk.JavaScriptExceptionTest);
|
1957
|
+
|
1958
|
+
|
1959
|
+
|
1687
1960
|
smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1688
1961
|
smalltalk.addMethod(
|
1689
1962
|
"_testAbs",
|
@@ -1691,9 +1964,9 @@ smalltalk.method({
|
|
1691
1964
|
selector: "testAbs",
|
1692
1965
|
fn: function (){
|
1693
1966
|
var self=this;
|
1694
|
-
smalltalk.
|
1695
|
-
|
1696
|
-
return self}
|
1967
|
+
return smalltalk.withContext(function($ctx1) {
|
1968
|
+
_st(self)._assert_(_st(_st((-4))._abs()).__eq((4)));
|
1969
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAbs",{}, smalltalk.NumberTest)})}
|
1697
1970
|
}),
|
1698
1971
|
smalltalk.NumberTest);
|
1699
1972
|
|
@@ -1703,14 +1976,14 @@ smalltalk.method({
|
|
1703
1976
|
selector: "testArithmetic",
|
1704
1977
|
fn: function (){
|
1705
1978
|
var self=this;
|
1706
|
-
smalltalk.
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
return self}
|
1979
|
+
return smalltalk.withContext(function($ctx1) {
|
1980
|
+
_st(self)._assert_(_st(_st((2)).__minus((1))).__eq((1)));
|
1981
|
+
_st(self)._assert_(_st(_st((-2)).__minus((1))).__eq((-3)));
|
1982
|
+
_st(self)._assert_(_st(_st((12)).__slash((2))).__eq((6)));
|
1983
|
+
_st(self)._assert_(_st(_st((3)).__star((4))).__eq((12)));
|
1984
|
+
_st(self)._assert_(_st(_st(_st((1)).__plus((2))).__star((3))).__eq((9)));
|
1985
|
+
_st(self)._assert_(_st(_st((1)).__plus(_st((2)).__star((3)))).__eq((7)));
|
1986
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{}, smalltalk.NumberTest)})}
|
1714
1987
|
}),
|
1715
1988
|
smalltalk.NumberTest);
|
1716
1989
|
|
@@ -1720,15 +1993,15 @@ smalltalk.method({
|
|
1720
1993
|
selector: "testComparison",
|
1721
1994
|
fn: function (){
|
1722
1995
|
var self=this;
|
1723
|
-
smalltalk.
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
return self}
|
1996
|
+
return smalltalk.withContext(function($ctx1) {
|
1997
|
+
_st(self)._assert_(_st((2)).__lt((3)));
|
1998
|
+
_st(self)._deny_(_st((3)).__lt((2)));
|
1999
|
+
_st(self)._deny_(_st((2)).__gt((3)));
|
2000
|
+
_st(self)._assert_(_st((3)).__gt_eq((3)));
|
2001
|
+
_st(self)._assert_(_st((3.1)).__gt_eq((3)));
|
2002
|
+
_st(self)._assert_(_st((3)).__lt_eq((3)));
|
2003
|
+
_st(self)._assert_(_st((3)).__lt_eq((3.1)));
|
2004
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testComparison",{}, smalltalk.NumberTest)})}
|
1732
2005
|
}),
|
1733
2006
|
smalltalk.NumberTest);
|
1734
2007
|
|
@@ -1738,9 +2011,9 @@ smalltalk.method({
|
|
1738
2011
|
selector: "testCopying",
|
1739
2012
|
fn: function (){
|
1740
2013
|
var self=this;
|
1741
|
-
smalltalk.
|
1742
|
-
|
1743
|
-
return self}
|
2014
|
+
return smalltalk.withContext(function($ctx1) {
|
2015
|
+
_st(self)._assert_(_st(_st((1))._deepCopy()).__eq_eq((1)));
|
2016
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.NumberTest)})}
|
1744
2017
|
}),
|
1745
2018
|
smalltalk.NumberTest);
|
1746
2019
|
|
@@ -1750,17 +2023,34 @@ smalltalk.method({
|
|
1750
2023
|
selector: "testEquality",
|
1751
2024
|
fn: function (){
|
1752
2025
|
var self=this;
|
1753
|
-
smalltalk.
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
return self}
|
2026
|
+
return smalltalk.withContext(function($ctx1) {
|
2027
|
+
_st(self)._assert_(_st((0)).__eq((0)));
|
2028
|
+
_st(self)._deny_(_st((1)).__eq((0)));
|
2029
|
+
_st(self)._assert_(_st(_st((1))._yourself()).__eq((1)));
|
2030
|
+
_st(self)._assert_(_st((1)).__eq(_st((1))._yourself()));
|
2031
|
+
_st(self)._assert_(_st(_st((1))._yourself()).__eq(_st((1))._yourself()));
|
2032
|
+
_st(self)._deny_(_st((0)).__eq(false));
|
2033
|
+
_st(self)._deny_(_st(false).__eq((0)));
|
2034
|
+
_st(self)._deny_(_st("").__eq((0)));
|
2035
|
+
_st(self)._deny_(_st((0)).__eq(""));
|
2036
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{}, smalltalk.NumberTest)})}
|
2037
|
+
}),
|
2038
|
+
smalltalk.NumberTest);
|
2039
|
+
|
2040
|
+
smalltalk.addMethod(
|
2041
|
+
"_testHexNumbers",
|
2042
|
+
smalltalk.method({
|
2043
|
+
selector: "testHexNumbers",
|
2044
|
+
fn: function (){
|
2045
|
+
var self=this;
|
2046
|
+
return smalltalk.withContext(function($ctx1) {
|
2047
|
+
_st(self)._assert_(_st(_st((10))._truncated()).__eq((10)));
|
2048
|
+
_st(self)._assert_(_st(_st((11))._truncated()).__eq((11)));
|
2049
|
+
_st(self)._assert_(_st(_st((12))._truncated()).__eq((12)));
|
2050
|
+
_st(self)._assert_(_st(_st((13))._truncated()).__eq((13)));
|
2051
|
+
_st(self)._assert_(_st(_st((14))._truncated()).__eq((14)));
|
2052
|
+
_st(self)._assert_(_st(_st((15))._truncated()).__eq((15)));
|
2053
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testHexNumbers",{}, smalltalk.NumberTest)})}
|
1764
2054
|
}),
|
1765
2055
|
smalltalk.NumberTest);
|
1766
2056
|
|
@@ -1770,14 +2060,147 @@ smalltalk.method({
|
|
1770
2060
|
selector: "testIdentity",
|
1771
2061
|
fn: function (){
|
1772
2062
|
var self=this;
|
1773
|
-
smalltalk.
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
return self}
|
2063
|
+
return smalltalk.withContext(function($ctx1) {
|
2064
|
+
_st(self)._assert_(_st((0)).__eq_eq((0)));
|
2065
|
+
_st(self)._deny_(_st((1)).__eq_eq((0)));
|
2066
|
+
_st(self)._assert_(_st(_st((1))._yourself()).__eq_eq((1)));
|
2067
|
+
_st(self)._assert_(_st((1)).__eq_eq(_st((1))._yourself()));
|
2068
|
+
_st(self)._assert_(_st(_st((1))._yourself()).__eq_eq(_st((1))._yourself()));
|
2069
|
+
_st(self)._deny_(_st((1)).__eq_eq((2)));
|
2070
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{}, smalltalk.NumberTest)})}
|
2071
|
+
}),
|
2072
|
+
smalltalk.NumberTest);
|
2073
|
+
|
2074
|
+
smalltalk.addMethod(
|
2075
|
+
"_testInvalidHexNumbers",
|
2076
|
+
smalltalk.method({
|
2077
|
+
selector: "testInvalidHexNumbers",
|
2078
|
+
fn: function (){
|
2079
|
+
var self=this;
|
2080
|
+
return smalltalk.withContext(function($ctx1) {
|
2081
|
+
return smalltalk.withContext(function($ctx2) {
|
2082
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2083
|
+
_st(self)._should_raise_((function(){
|
2084
|
+
return smalltalk.withContext(function($ctx2) {
|
2085
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2086
|
+
_st(self)._should_raise_((function(){
|
2087
|
+
return smalltalk.withContext(function($ctx2) {
|
2088
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2089
|
+
_st(self)._should_raise_((function(){
|
2090
|
+
return smalltalk.withContext(function($ctx2) {
|
2091
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2092
|
+
_st(self)._should_raise_((function(){
|
2093
|
+
return smalltalk.withContext(function($ctx2) {
|
2094
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2095
|
+
_st(self)._should_raise_((function(){
|
2096
|
+
return smalltalk.withContext(function($ctx2) {
|
2097
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2098
|
+
_st(self)._should_raise_((function(){
|
2099
|
+
return smalltalk.withContext(function($ctx2) {
|
2100
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2101
|
+
_st(self)._should_raise_((function(){
|
2102
|
+
return smalltalk.withContext(function($ctx2) {
|
2103
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2104
|
+
_st(self)._should_raise_((function(){
|
2105
|
+
return smalltalk.withContext(function($ctx2) {
|
2106
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2107
|
+
_st(self)._should_raise_((function(){
|
2108
|
+
return smalltalk.withContext(function($ctx2) {
|
2109
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2110
|
+
_st(self)._should_raise_((function(){
|
2111
|
+
return smalltalk.withContext(function($ctx2) {
|
2112
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2113
|
+
_st(self)._should_raise_((function(){
|
2114
|
+
return smalltalk.withContext(function($ctx2) {
|
2115
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2116
|
+
_st(self)._should_raise_((function(){
|
2117
|
+
return smalltalk.withContext(function($ctx2) {
|
2118
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2119
|
+
_st(self)._should_raise_((function(){
|
2120
|
+
return smalltalk.withContext(function($ctx2) {
|
2121
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2122
|
+
_st(self)._should_raise_((function(){
|
2123
|
+
return smalltalk.withContext(function($ctx2) {
|
2124
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2125
|
+
_st(self)._should_raise_((function(){
|
2126
|
+
return smalltalk.withContext(function($ctx2) {
|
2127
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2128
|
+
_st(self)._should_raise_((function(){
|
2129
|
+
return smalltalk.withContext(function($ctx2) {
|
2130
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2131
|
+
_st(self)._should_raise_((function(){
|
2132
|
+
return smalltalk.withContext(function($ctx2) {
|
2133
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2134
|
+
_st(self)._should_raise_((function(){
|
2135
|
+
return smalltalk.withContext(function($ctx2) {
|
2136
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2137
|
+
_st(self)._should_raise_((function(){
|
2138
|
+
return smalltalk.withContext(function($ctx2) {
|
2139
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2140
|
+
_st(self)._should_raise_((function(){
|
2141
|
+
return smalltalk.withContext(function($ctx2) {
|
2142
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2143
|
+
_st(self)._should_raise_((function(){
|
2144
|
+
return smalltalk.withContext(function($ctx2) {
|
2145
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2146
|
+
_st(self)._should_raise_((function(){
|
2147
|
+
return smalltalk.withContext(function($ctx2) {
|
2148
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2149
|
+
_st(self)._should_raise_((function(){
|
2150
|
+
return smalltalk.withContext(function($ctx2) {
|
2151
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2152
|
+
_st(self)._should_raise_((function(){
|
2153
|
+
return smalltalk.withContext(function($ctx2) {
|
2154
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2155
|
+
_st(self)._should_raise_((function(){
|
2156
|
+
return smalltalk.withContext(function($ctx2) {
|
2157
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2158
|
+
_st(self)._should_raise_((function(){
|
2159
|
+
return smalltalk.withContext(function($ctx2) {
|
2160
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2161
|
+
_st(self)._should_raise_((function(){
|
2162
|
+
return smalltalk.withContext(function($ctx2) {
|
2163
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2164
|
+
_st(self)._should_raise_((function(){
|
2165
|
+
return smalltalk.withContext(function($ctx2) {
|
2166
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2167
|
+
_st(self)._should_raise_((function(){
|
2168
|
+
return smalltalk.withContext(function($ctx2) {
|
2169
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2170
|
+
_st(self)._should_raise_((function(){
|
2171
|
+
return smalltalk.withContext(function($ctx2) {
|
2172
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2173
|
+
_st(self)._should_raise_((function(){
|
2174
|
+
return smalltalk.withContext(function($ctx2) {
|
2175
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2176
|
+
_st(self)._should_raise_((function(){
|
2177
|
+
return smalltalk.withContext(function($ctx2) {
|
2178
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2179
|
+
_st(self)._should_raise_((function(){
|
2180
|
+
return smalltalk.withContext(function($ctx2) {
|
2181
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2182
|
+
_st(self)._should_raise_((function(){
|
2183
|
+
return smalltalk.withContext(function($ctx2) {
|
2184
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2185
|
+
_st(self)._should_raise_((function(){
|
2186
|
+
return smalltalk.withContext(function($ctx2) {
|
2187
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2188
|
+
_st(self)._should_raise_((function(){
|
2189
|
+
return smalltalk.withContext(function($ctx2) {
|
2190
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2191
|
+
_st(self)._should_raise_((function(){
|
2192
|
+
return smalltalk.withContext(function($ctx2) {
|
2193
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2194
|
+
_st(self)._should_raise_((function(){
|
2195
|
+
return smalltalk.withContext(function($ctx2) {
|
2196
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2197
|
+
_st(self)._should_raise_((function(){
|
2198
|
+
return smalltalk.withContext(function($ctx2) {
|
2199
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2200
|
+
_st(self)._should_raise_((function(){
|
2201
|
+
return smalltalk.withContext(function($ctx2) {
|
2202
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2203
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInvalidHexNumbers",{}, smalltalk.NumberTest)})}
|
1781
2204
|
}),
|
1782
2205
|
smalltalk.NumberTest);
|
1783
2206
|
|
@@ -1787,9 +2210,9 @@ smalltalk.method({
|
|
1787
2210
|
selector: "testMinMax",
|
1788
2211
|
fn: function (){
|
1789
2212
|
var self=this;
|
1790
|
-
smalltalk.
|
1791
|
-
|
1792
|
-
return self}
|
2213
|
+
return smalltalk.withContext(function($ctx1) {
|
2214
|
+
_st(self)._assert_equals_(_st((2))._min_((5)),(2));
|
2215
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testMinMax",{}, smalltalk.NumberTest)})}
|
1793
2216
|
}),
|
1794
2217
|
smalltalk.NumberTest);
|
1795
2218
|
|
@@ -1799,9 +2222,9 @@ smalltalk.method({
|
|
1799
2222
|
selector: "testNegated",
|
1800
2223
|
fn: function (){
|
1801
2224
|
var self=this;
|
1802
|
-
smalltalk.
|
1803
|
-
|
1804
|
-
return self}
|
2225
|
+
return smalltalk.withContext(function($ctx1) {
|
2226
|
+
_st(self)._assert_(_st(_st((-3))._negated()).__eq((3)));
|
2227
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNegated",{}, smalltalk.NumberTest)})}
|
1805
2228
|
}),
|
1806
2229
|
smalltalk.NumberTest);
|
1807
2230
|
|
@@ -1811,20 +2234,20 @@ smalltalk.method({
|
|
1811
2234
|
selector: "testPrintShowingDecimalPlaces",
|
1812
2235
|
fn: function (){
|
1813
2236
|
var self=this;
|
1814
|
-
smalltalk.
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
return self}
|
2237
|
+
return smalltalk.withContext(function($ctx1) {
|
2238
|
+
_st(self)._assert_equals_("23.57",_st((23.5698))._printShowingDecimalPlaces_((2)));
|
2239
|
+
_st(self)._assert_equals_("-234.56700",_st(_st((234.567))._negated())._printShowingDecimalPlaces_((5)));
|
2240
|
+
_st(self)._assert_equals_("23",_st((23.4567))._printShowingDecimalPlaces_((0)));
|
2241
|
+
_st(self)._assert_equals_("24",_st((23.5567))._printShowingDecimalPlaces_((0)));
|
2242
|
+
_st(self)._assert_equals_("-23",_st(_st((23.4567))._negated())._printShowingDecimalPlaces_((0)));
|
2243
|
+
_st(self)._assert_equals_("-24",_st(_st((23.5567))._negated())._printShowingDecimalPlaces_((0)));
|
2244
|
+
_st(self)._assert_equals_("100000000.0",_st((100000000))._printShowingDecimalPlaces_((1)));
|
2245
|
+
_st(self)._assert_equals_("0.98000",_st((0.98))._printShowingDecimalPlaces_((5)));
|
2246
|
+
_st(self)._assert_equals_("-0.98",_st(_st((0.98))._negated())._printShowingDecimalPlaces_((2)));
|
2247
|
+
_st(self)._assert_equals_("2.57",_st((2.567))._printShowingDecimalPlaces_((2)));
|
2248
|
+
_st(self)._assert_equals_("-2.57",_st((-2.567))._printShowingDecimalPlaces_((2)));
|
2249
|
+
_st(self)._assert_equals_("0.00",_st((0))._printShowingDecimalPlaces_((2)));
|
2250
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPrintShowingDecimalPlaces",{}, smalltalk.NumberTest)})}
|
1828
2251
|
}),
|
1829
2252
|
smalltalk.NumberTest);
|
1830
2253
|
|
@@ -1834,10 +2257,10 @@ smalltalk.method({
|
|
1834
2257
|
selector: "testRounded",
|
1835
2258
|
fn: function (){
|
1836
2259
|
var self=this;
|
1837
|
-
smalltalk.
|
1838
|
-
|
1839
|
-
|
1840
|
-
return self}
|
2260
|
+
return smalltalk.withContext(function($ctx1) {
|
2261
|
+
_st(self)._assert_(_st(_st((3.212))._rounded()).__eq((3)));
|
2262
|
+
_st(self)._assert_(_st(_st((3.51))._rounded()).__eq((4)));
|
2263
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testRounded",{}, smalltalk.NumberTest)})}
|
1841
2264
|
}),
|
1842
2265
|
smalltalk.NumberTest);
|
1843
2266
|
|
@@ -1847,9 +2270,9 @@ smalltalk.method({
|
|
1847
2270
|
selector: "testSqrt",
|
1848
2271
|
fn: function (){
|
1849
2272
|
var self=this;
|
1850
|
-
smalltalk.
|
1851
|
-
|
1852
|
-
return self}
|
2273
|
+
return smalltalk.withContext(function($ctx1) {
|
2274
|
+
_st(self)._assert_(_st(_st((16))._sqrt()).__eq((4)));
|
2275
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSqrt",{}, smalltalk.NumberTest)})}
|
1853
2276
|
}),
|
1854
2277
|
smalltalk.NumberTest);
|
1855
2278
|
|
@@ -1859,8 +2282,8 @@ smalltalk.method({
|
|
1859
2282
|
selector: "testSquared",
|
1860
2283
|
fn: function (){
|
1861
2284
|
var self=this;
|
1862
|
-
smalltalk.
|
1863
|
-
return self}
|
2285
|
+
return smalltalk.withContext(function($ctx1) {
|
2286
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSquared",{}, smalltalk.NumberTest)})}
|
1864
2287
|
}),
|
1865
2288
|
smalltalk.NumberTest);
|
1866
2289
|
|
@@ -1871,18 +2294,18 @@ selector: "testTimesRepeat",
|
|
1871
2294
|
fn: function (){
|
1872
2295
|
var self=this;
|
1873
2296
|
var i;
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
2297
|
+
return smalltalk.withContext(function($ctx1) {
|
2298
|
+
_st((0))._timesRepeat_((function(){
|
2299
|
+
return smalltalk.withContext(function($ctx2) {
|
1877
2300
|
return i;
|
1878
|
-
})
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
2301
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
2302
|
+
_st(self)._assert_equals_(i,(0));
|
2303
|
+
_st((5))._timesRepeat_((function(){
|
2304
|
+
return smalltalk.withContext(function($ctx2) {
|
1882
2305
|
return i;
|
1883
|
-
})
|
1884
|
-
|
1885
|
-
return self}
|
2306
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
2307
|
+
_st(self)._assert_equals_(i,(5));
|
2308
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTimesRepeat",{i:i}, smalltalk.NumberTest)})}
|
1886
2309
|
}),
|
1887
2310
|
smalltalk.NumberTest);
|
1888
2311
|
|
@@ -1892,8 +2315,8 @@ smalltalk.method({
|
|
1892
2315
|
selector: "testTo",
|
1893
2316
|
fn: function (){
|
1894
2317
|
var self=this;
|
1895
|
-
smalltalk.
|
1896
|
-
return self}
|
2318
|
+
return smalltalk.withContext(function($ctx1) {
|
2319
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTo",{}, smalltalk.NumberTest)})}
|
1897
2320
|
}),
|
1898
2321
|
smalltalk.NumberTest);
|
1899
2322
|
|
@@ -1903,11 +2326,11 @@ smalltalk.method({
|
|
1903
2326
|
selector: "testToBy",
|
1904
2327
|
fn: function (){
|
1905
2328
|
var self=this;
|
1906
|
-
smalltalk.
|
1907
|
-
|
1908
|
-
return smalltalk.
|
1909
|
-
}),(smalltalk.Error || Error)
|
1910
|
-
return self}
|
2329
|
+
return smalltalk.withContext(function($ctx1) {
|
2330
|
+
_st(self)._should_raise_((function(){
|
2331
|
+
return smalltalk.withContext(function($ctx2) {
|
2332
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
2333
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testToBy",{}, smalltalk.NumberTest)})}
|
1911
2334
|
}),
|
1912
2335
|
smalltalk.NumberTest);
|
1913
2336
|
|
@@ -1917,10 +2340,10 @@ smalltalk.method({
|
|
1917
2340
|
selector: "testTruncated",
|
1918
2341
|
fn: function (){
|
1919
2342
|
var self=this;
|
1920
|
-
smalltalk.
|
1921
|
-
|
1922
|
-
|
1923
|
-
return self}
|
2343
|
+
return smalltalk.withContext(function($ctx1) {
|
2344
|
+
_st(self)._assert_(_st(_st((3.212))._truncated()).__eq((3)));
|
2345
|
+
_st(self)._assert_(_st(_st((3.51))._truncated()).__eq((3)));
|
2346
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTruncated",{}, smalltalk.NumberTest)})}
|
1924
2347
|
}),
|
1925
2348
|
smalltalk.NumberTest);
|
1926
2349
|
|
@@ -1933,8 +2356,10 @@ smalltalk.method({
|
|
1933
2356
|
selector: "foo",
|
1934
2357
|
fn: function (){
|
1935
2358
|
var self=this;
|
1936
|
-
return
|
1937
|
-
|
2359
|
+
return smalltalk.withContext(function($ctx1) {
|
2360
|
+
$1=self["@foo"];
|
2361
|
+
return $1;
|
2362
|
+
}, function($ctx1) {$ctx1.fill(self,"foo",{}, smalltalk.ObjectMock)})}
|
1938
2363
|
}),
|
1939
2364
|
smalltalk.ObjectMock);
|
1940
2365
|
|
@@ -1944,14 +2369,25 @@ smalltalk.method({
|
|
1944
2369
|
selector: "foo:",
|
1945
2370
|
fn: function (anObject){
|
1946
2371
|
var self=this;
|
1947
|
-
|
1948
|
-
return self}
|
2372
|
+
return smalltalk.withContext(function($ctx1) {
|
2373
|
+
return self}, function($ctx1) {$ctx1.fill(self,"foo:",{anObject:anObject}, smalltalk.ObjectMock)})}
|
1949
2374
|
}),
|
1950
2375
|
smalltalk.ObjectMock);
|
1951
2376
|
|
1952
2377
|
|
1953
2378
|
|
1954
2379
|
smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
2380
|
+
smalltalk.addMethod(
|
2381
|
+
"_notDefined",
|
2382
|
+
smalltalk.method({
|
2383
|
+
selector: "notDefined",
|
2384
|
+
fn: function (){
|
2385
|
+
var self=this;
|
2386
|
+
return smalltalk.withContext(function($ctx1) {
|
2387
|
+
return self}, function($ctx1) {$ctx1.fill(self,"notDefined",{}, smalltalk.ObjectTest)})}
|
2388
|
+
}),
|
2389
|
+
smalltalk.ObjectTest);
|
2390
|
+
|
1955
2391
|
smalltalk.addMethod(
|
1956
2392
|
"_testBasicAccess",
|
1957
2393
|
smalltalk.method({
|
@@ -1959,11 +2395,11 @@ selector: "testBasicAccess",
|
|
1959
2395
|
fn: function (){
|
1960
2396
|
var self=this;
|
1961
2397
|
var o;
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
return self}
|
2398
|
+
return smalltalk.withContext(function($ctx1) {
|
2399
|
+
_st(o)._basicAt_put_("a",(1));
|
2400
|
+
_st(self)._assert_equals_(_st(o)._basicAt_("a"),(1));
|
2401
|
+
_st(self)._assert_equals_(_st(o)._basicAt_("b"),nil);
|
2402
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testBasicAccess",{o:o}, smalltalk.ObjectTest)})}
|
1967
2403
|
}),
|
1968
2404
|
smalltalk.ObjectTest);
|
1969
2405
|
|
@@ -1974,16 +2410,16 @@ selector: "testBasicPerform",
|
|
1974
2410
|
fn: function (){
|
1975
2411
|
var self=this;
|
1976
2412
|
var o;
|
1977
|
-
|
1978
|
-
|
1979
|
-
return
|
1980
|
-
})
|
1981
|
-
|
1982
|
-
return smalltalk.
|
1983
|
-
})
|
1984
|
-
|
1985
|
-
|
1986
|
-
return self}
|
2413
|
+
return smalltalk.withContext(function($ctx1) {
|
2414
|
+
_st(o)._basicAt_put_("func",(function(){
|
2415
|
+
return smalltalk.withContext(function($ctx2) {
|
2416
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
2417
|
+
_st(o)._basicAt_put_("func2",(function(a){
|
2418
|
+
return smalltalk.withContext(function($ctx2) {
|
2419
|
+
}, function($ctx2) {$ctx2.fillBlock({a:a},$ctx1)})}));
|
2420
|
+
_st(self)._assert_equals_(_st(o)._basicPerform_("func"),"hello");
|
2421
|
+
_st(self)._assert_equals_(_st(o)._basicPerform_withArguments_("func2",[(3)]),(4));
|
2422
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testBasicPerform",{o:o}, smalltalk.ObjectTest)})}
|
1987
2423
|
}),
|
1988
2424
|
smalltalk.ObjectTest);
|
1989
2425
|
|
@@ -1993,10 +2429,10 @@ smalltalk.method({
|
|
1993
2429
|
selector: "testDNU",
|
1994
2430
|
fn: function (){
|
1995
2431
|
var self=this;
|
1996
|
-
smalltalk.
|
1997
|
-
return smalltalk.
|
1998
|
-
}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)
|
1999
|
-
return self}
|
2432
|
+
return smalltalk.withContext(function($ctx1) {
|
2433
|
+
return smalltalk.withContext(function($ctx2) {
|
2434
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood));
|
2435
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDNU",{}, smalltalk.ObjectTest)})}
|
2000
2436
|
}),
|
2001
2437
|
smalltalk.ObjectTest);
|
2002
2438
|
|
@@ -2007,12 +2443,12 @@ selector: "testEquality",
|
|
2007
2443
|
fn: function (){
|
2008
2444
|
var self=this;
|
2009
2445
|
var o;
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
return self}
|
2446
|
+
return smalltalk.withContext(function($ctx1) {
|
2447
|
+
_st(self)._deny_(_st(o).__eq(_st((smalltalk.Object || Object))._new()));
|
2448
|
+
_st(self)._assert_(_st(o).__eq(o));
|
2449
|
+
_st(self)._assert_(_st(_st(o)._yourself()).__eq(o));
|
2450
|
+
_st(self)._assert_(_st(o).__eq(_st(o)._yourself()));
|
2451
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEquality",{o:o}, smalltalk.ObjectTest)})}
|
2016
2452
|
}),
|
2017
2453
|
smalltalk.ObjectTest);
|
2018
2454
|
|
@@ -2022,10 +2458,10 @@ smalltalk.method({
|
|
2022
2458
|
selector: "testHalt",
|
2023
2459
|
fn: function (){
|
2024
2460
|
var self=this;
|
2025
|
-
smalltalk.
|
2026
|
-
return smalltalk.
|
2027
|
-
}),(smalltalk.Error || Error)
|
2028
|
-
return self}
|
2461
|
+
return smalltalk.withContext(function($ctx1) {
|
2462
|
+
return smalltalk.withContext(function($ctx2) {
|
2463
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
2464
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testHalt",{}, smalltalk.ObjectTest)})}
|
2029
2465
|
}),
|
2030
2466
|
smalltalk.ObjectTest);
|
2031
2467
|
|
@@ -2036,12 +2472,12 @@ selector: "testIdentity",
|
|
2036
2472
|
fn: function (){
|
2037
2473
|
var self=this;
|
2038
2474
|
var o;
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
return self}
|
2475
|
+
return smalltalk.withContext(function($ctx1) {
|
2476
|
+
_st(self)._deny_(_st(o).__eq_eq(_st((smalltalk.Object || Object))._new()));
|
2477
|
+
_st(self)._assert_(_st(o).__eq_eq(o));
|
2478
|
+
_st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
|
2479
|
+
_st(self)._assert_(_st(o).__eq_eq(_st(o)._yourself()));
|
2480
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIdentity",{o:o}, smalltalk.ObjectTest)})}
|
2045
2481
|
}),
|
2046
2482
|
smalltalk.ObjectTest);
|
2047
2483
|
|
@@ -2051,35 +2487,41 @@ smalltalk.method({
|
|
2051
2487
|
selector: "testIfNil",
|
2052
2488
|
fn: function (){
|
2053
2489
|
var self=this;
|
2054
|
-
|
2055
|
-
|
2056
|
-
$
|
2057
|
-
|
2058
|
-
$1=true;
|
2059
|
-
} else {
|
2060
|
-
$1=$2;
|
2061
|
-
};
|
2062
|
-
smalltalk.send(self,"_deny_",[smalltalk.send($1,"__eq",[true])]);
|
2063
|
-
$4=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
2490
|
+
return smalltalk.withContext(function($ctx1) {
|
2491
|
+
_st(self)._deny_(_st(_st((smalltalk.Object || Object))._new())._isNil());
|
2492
|
+
$1=self;
|
2493
|
+
$4=_st((smalltalk.Object || Object))._new();
|
2064
2494
|
if(($receiver = $4) == nil || $receiver == undefined){
|
2495
|
+
$3=true;
|
2496
|
+
} else {
|
2065
2497
|
$3=$4;
|
2498
|
+
};
|
2499
|
+
$2=_st($3).__eq(true);
|
2500
|
+
_st($1)._deny_($2);
|
2501
|
+
$5=self;
|
2502
|
+
$8=_st((smalltalk.Object || Object))._new();
|
2503
|
+
if(($receiver = $8) == nil || $receiver == undefined){
|
2504
|
+
$7=$8;
|
2066
2505
|
} else {
|
2067
|
-
$
|
2506
|
+
$7=true;
|
2068
2507
|
};
|
2069
|
-
|
2070
|
-
$
|
2071
|
-
|
2072
|
-
$
|
2508
|
+
$6=_st($7).__eq(true);
|
2509
|
+
_st($5)._assert_($6);
|
2510
|
+
$9=self;
|
2511
|
+
$12=_st((smalltalk.Object || Object))._new();
|
2512
|
+
if(($receiver = $12) == nil || $receiver == undefined){
|
2513
|
+
$11=false;
|
2073
2514
|
} else {
|
2074
|
-
$
|
2515
|
+
$11=true;
|
2075
2516
|
};
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2517
|
+
$10=_st($11).__eq(true);
|
2518
|
+
_st($9)._assert_($10);
|
2519
|
+
_st(self)._assert_(_st(_st(_st((smalltalk.Object || Object))._new())._ifNotNil_ifNil_((function(){
|
2520
|
+
return smalltalk.withContext(function($ctx2) {
|
2521
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
|
2522
|
+
return smalltalk.withContext(function($ctx2) {
|
2523
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
|
2524
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{}, smalltalk.ObjectTest)})}
|
2083
2525
|
}),
|
2084
2526
|
smalltalk.ObjectTest);
|
2085
2527
|
|
@@ -2090,12 +2532,12 @@ selector: "testInstVars",
|
|
2090
2532
|
fn: function (){
|
2091
2533
|
var self=this;
|
2092
2534
|
var o;
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
return self}
|
2535
|
+
return smalltalk.withContext(function($ctx1) {
|
2536
|
+
_st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),nil);
|
2537
|
+
_st(o)._instVarAt_put_(smalltalk.symbolFor("foo"),(1));
|
2538
|
+
_st(self)._assert_equals_(_st(o)._instVarAt_(smalltalk.symbolFor("foo")),(1));
|
2539
|
+
_st(self)._assert_equals_(_st(o)._instVarAt_("foo"),(1));
|
2540
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInstVars",{o:o}, smalltalk.ObjectTest)})}
|
2099
2541
|
}),
|
2100
2542
|
smalltalk.ObjectTest);
|
2101
2543
|
|
@@ -2105,11 +2547,8 @@ smalltalk.method({
|
|
2105
2547
|
selector: "testNilUndefined",
|
2106
2548
|
fn: function (){
|
2107
2549
|
var self=this;
|
2108
|
-
|
2109
|
-
|
2110
|
-
;
|
2111
|
-
smalltalk.send(self,"_assert_",[smalltalk.send(nil,"__eq",[notDefined])]);
|
2112
|
-
return self}
|
2550
|
+
return smalltalk.withContext(function($ctx1) {
|
2551
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNilUndefined",{}, smalltalk.ObjectTest)})}
|
2113
2552
|
}),
|
2114
2553
|
smalltalk.ObjectTest);
|
2115
2554
|
|
@@ -2117,13 +2556,12 @@ smalltalk.addMethod(
|
|
2117
2556
|
"_testYourself",
|
2118
2557
|
smalltalk.method({
|
2119
2558
|
selector: "testYourself",
|
2120
|
-
fn: function ()
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
}
|
2559
|
+
fn: function (){
|
2560
|
+
var self=this;
|
2561
|
+
var o;
|
2562
|
+
return smalltalk.withContext(function($ctx1) {
|
2563
|
+
_st(self)._assert_(_st(_st(o)._yourself()).__eq_eq(o));
|
2564
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testYourself",{o:o}, smalltalk.ObjectTest)})}
|
2127
2565
|
}),
|
2128
2566
|
smalltalk.ObjectTest);
|
2129
2567
|
|
@@ -2131,16 +2569,14 @@ smalltalk.addMethod(
|
|
2131
2569
|
"_testidentityHash",
|
2132
2570
|
smalltalk.method({
|
2133
2571
|
selector: "testidentityHash",
|
2134
|
-
fn: function ()
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
return self;
|
2143
|
-
}
|
2572
|
+
fn: function (){
|
2573
|
+
var self=this;
|
2574
|
+
var o1,o2;
|
2575
|
+
return smalltalk.withContext(function($ctx1) {
|
2576
|
+
o2=_st((smalltalk.Object || Object))._new();
|
2577
|
+
_st(self)._assert_(_st(_st(o1)._identityHash()).__eq_eq(_st(o1)._identityHash()));
|
2578
|
+
_st(self)._deny_(_st(_st(o1)._identityHash()).__eq_eq(_st(o2)._identityHash()));
|
2579
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testidentityHash",{o1:o1,o2:o2}, smalltalk.ObjectTest)})}
|
2144
2580
|
}),
|
2145
2581
|
smalltalk.ObjectTest);
|
2146
2582
|
|
@@ -2153,18 +2589,18 @@ smalltalk.method({
|
|
2153
2589
|
selector: "setUp",
|
2154
2590
|
fn: function (){
|
2155
2591
|
var self=this;
|
2156
|
-
|
2157
|
-
self["@backUpCommitPathJs"]=
|
2158
|
-
self["@backUpCommitPathSt"]=
|
2159
|
-
|
2160
|
-
self["@zorkPackage"]=
|
2161
|
-
$1=
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
$2=
|
2592
|
+
return smalltalk.withContext(function($ctx1) {
|
2593
|
+
self["@backUpCommitPathJs"]=_st((smalltalk.Package || Package))._defaultCommitPathJs();
|
2594
|
+
self["@backUpCommitPathSt"]=_st((smalltalk.Package || Package))._defaultCommitPathSt();
|
2595
|
+
_st((smalltalk.Package || Package))._resetCommitPaths();
|
2596
|
+
self["@zorkPackage"]=_st(_st((smalltalk.Package || Package))._new())._name_("Zork");
|
2597
|
+
$1=_st((smalltalk.Package || Package))._new();
|
2598
|
+
_st($1)._name_("Grul");
|
2599
|
+
_st($1)._commitPathJs_("server/grul/js");
|
2600
|
+
_st($1)._commitPathSt_("grul/st");
|
2601
|
+
$2=_st($1)._yourself();
|
2166
2602
|
self["@grulPackage"]=$2;
|
2167
|
-
return self}
|
2603
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.PackageTest)})}
|
2168
2604
|
}),
|
2169
2605
|
smalltalk.PackageTest);
|
2170
2606
|
|
@@ -2174,10 +2610,11 @@ smalltalk.method({
|
|
2174
2610
|
selector: "tearDown",
|
2175
2611
|
fn: function (){
|
2176
2612
|
var self=this;
|
2177
|
-
|
2178
|
-
|
2179
|
-
$1
|
2180
|
-
|
2613
|
+
return smalltalk.withContext(function($ctx1) {
|
2614
|
+
$1=(smalltalk.Package || Package);
|
2615
|
+
_st($1)._defaultCommitPathJs_(self["@backUpCommitPathJs"]);
|
2616
|
+
$2=_st($1)._defaultCommitPathSt_(self["@backUpCommitPathSt"]);
|
2617
|
+
return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{}, smalltalk.PackageTest)})}
|
2181
2618
|
}),
|
2182
2619
|
smalltalk.PackageTest);
|
2183
2620
|
|
@@ -2187,8 +2624,8 @@ smalltalk.method({
|
|
2187
2624
|
selector: "testGrulCommitPathJsShouldBeServerGrulJs",
|
2188
2625
|
fn: function (){
|
2189
2626
|
var self=this;
|
2190
|
-
smalltalk.
|
2191
|
-
return self}
|
2627
|
+
return smalltalk.withContext(function($ctx1) {
|
2628
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{}, smalltalk.PackageTest)})}
|
2192
2629
|
}),
|
2193
2630
|
smalltalk.PackageTest);
|
2194
2631
|
|
@@ -2198,8 +2635,8 @@ smalltalk.method({
|
|
2198
2635
|
selector: "testGrulCommitPathStShouldBeGrulSt",
|
2199
2636
|
fn: function (){
|
2200
2637
|
var self=this;
|
2201
|
-
smalltalk.
|
2202
|
-
return self}
|
2638
|
+
return smalltalk.withContext(function($ctx1) {
|
2639
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{}, smalltalk.PackageTest)})}
|
2203
2640
|
}),
|
2204
2641
|
smalltalk.PackageTest);
|
2205
2642
|
|
@@ -2209,8 +2646,8 @@ smalltalk.method({
|
|
2209
2646
|
selector: "testZorkCommitPathJsShouldBeJs",
|
2210
2647
|
fn: function (){
|
2211
2648
|
var self=this;
|
2212
|
-
smalltalk.
|
2213
|
-
return self}
|
2649
|
+
return smalltalk.withContext(function($ctx1) {
|
2650
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJs",{}, smalltalk.PackageTest)})}
|
2214
2651
|
}),
|
2215
2652
|
smalltalk.PackageTest);
|
2216
2653
|
|
@@ -2220,8 +2657,8 @@ smalltalk.method({
|
|
2220
2657
|
selector: "testZorkCommitPathStShouldBeSt",
|
2221
2658
|
fn: function (){
|
2222
2659
|
var self=this;
|
2223
|
-
smalltalk.
|
2224
|
-
return self}
|
2660
|
+
return smalltalk.withContext(function($ctx1) {
|
2661
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSt",{}, smalltalk.PackageTest)})}
|
2225
2662
|
}),
|
2226
2663
|
smalltalk.PackageTest);
|
2227
2664
|
|
@@ -2234,11 +2671,12 @@ smalltalk.method({
|
|
2234
2671
|
selector: "setUp",
|
2235
2672
|
fn: function (){
|
2236
2673
|
var self=this;
|
2237
|
-
|
2238
|
-
smalltalk.
|
2239
|
-
|
2240
|
-
$1
|
2241
|
-
|
2674
|
+
return smalltalk.withContext(function($ctx1) {
|
2675
|
+
smalltalk.PackageTest.fn.prototype._setUp.apply(_st(self), []);
|
2676
|
+
$1=(smalltalk.Package || Package);
|
2677
|
+
_st($1)._defaultCommitPathJs_("javascripts/");
|
2678
|
+
$2=_st($1)._defaultCommitPathSt_("smalltalk/");
|
2679
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)})}
|
2242
2680
|
}),
|
2243
2681
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
2244
2682
|
|
@@ -2248,8 +2686,8 @@ smalltalk.method({
|
|
2248
2686
|
selector: "testGrulCommitPathJsShouldBeServerGrulJs",
|
2249
2687
|
fn: function (){
|
2250
2688
|
var self=this;
|
2251
|
-
smalltalk.
|
2252
|
-
return self}
|
2689
|
+
return smalltalk.withContext(function($ctx1) {
|
2690
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathJsShouldBeServerGrulJs",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)})}
|
2253
2691
|
}),
|
2254
2692
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
2255
2693
|
|
@@ -2259,8 +2697,8 @@ smalltalk.method({
|
|
2259
2697
|
selector: "testGrulCommitPathStShouldBeGrulSt",
|
2260
2698
|
fn: function (){
|
2261
2699
|
var self=this;
|
2262
|
-
smalltalk.
|
2263
|
-
return self}
|
2700
|
+
return smalltalk.withContext(function($ctx1) {
|
2701
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testGrulCommitPathStShouldBeGrulSt",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)})}
|
2264
2702
|
}),
|
2265
2703
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
2266
2704
|
|
@@ -2270,8 +2708,8 @@ smalltalk.method({
|
|
2270
2708
|
selector: "testZorkCommitPathJsShouldBeJavascript",
|
2271
2709
|
fn: function (){
|
2272
2710
|
var self=this;
|
2273
|
-
smalltalk.
|
2274
|
-
return self}
|
2711
|
+
return smalltalk.withContext(function($ctx1) {
|
2712
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathJsShouldBeJavascript",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)})}
|
2275
2713
|
}),
|
2276
2714
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
2277
2715
|
|
@@ -2281,8 +2719,8 @@ smalltalk.method({
|
|
2281
2719
|
selector: "testZorkCommitPathStShouldBeSmalltalk",
|
2282
2720
|
fn: function (){
|
2283
2721
|
var self=this;
|
2284
|
-
smalltalk.
|
2285
|
-
return self}
|
2722
|
+
return smalltalk.withContext(function($ctx1) {
|
2723
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testZorkCommitPathStShouldBeSmalltalk",{}, smalltalk.PackageWithDefaultCommitPathChangedTest)})}
|
2286
2724
|
}),
|
2287
2725
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
2288
2726
|
|
@@ -2293,8 +2731,8 @@ smalltalk.method({
|
|
2293
2731
|
selector: "shouldInheritSelectors",
|
2294
2732
|
fn: function (){
|
2295
2733
|
var self=this;
|
2296
|
-
return
|
2297
|
-
}
|
2734
|
+
return smalltalk.withContext(function($ctx1) {
|
2735
|
+
}, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{}, smalltalk.PackageWithDefaultCommitPathChangedTest.klass)})}
|
2298
2736
|
}),
|
2299
2737
|
smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
|
2300
2738
|
|
@@ -2306,11 +2744,11 @@ smalltalk.method({
|
|
2306
2744
|
selector: "testAccessing",
|
2307
2745
|
fn: function (){
|
2308
2746
|
var self=this;
|
2309
|
-
smalltalk.
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
return self}
|
2747
|
+
return smalltalk.withContext(function($ctx1) {
|
2748
|
+
_st(self)._assert_equals_(_st(_st((smalltalk.Point || Point))._x_y_((3),(4)))._y(),(4));
|
2749
|
+
_st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._x_((3)))._x(),(3));
|
2750
|
+
_st(self)._assert_equals_(_st(_st(_st((smalltalk.Point || Point))._new())._y_((4)))._y(),(4));
|
2751
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAccessing",{}, smalltalk.PointTest)})}
|
2314
2752
|
}),
|
2315
2753
|
smalltalk.PointTest);
|
2316
2754
|
|
@@ -2320,11 +2758,11 @@ smalltalk.method({
|
|
2320
2758
|
selector: "testArithmetic",
|
2321
2759
|
fn: function (){
|
2322
2760
|
var self=this;
|
2323
|
-
smalltalk.
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
return self}
|
2761
|
+
return smalltalk.withContext(function($ctx1) {
|
2762
|
+
_st(self)._assert_equals_(_st(_st((3)).__at((4))).__plus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((6),(8)));
|
2763
|
+
_st(self)._assert_equals_(_st(_st((3)).__at((4))).__minus(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((0),(0)));
|
2764
|
+
_st(self)._assert_equals_(_st(_st((6)).__at((8))).__slash(_st((3)).__at((4))),_st((smalltalk.Point || Point))._x_y_((2),(2)));
|
2765
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testArithmetic",{}, smalltalk.PointTest)})}
|
2328
2766
|
}),
|
2329
2767
|
smalltalk.PointTest);
|
2330
2768
|
|
@@ -2334,8 +2772,8 @@ smalltalk.method({
|
|
2334
2772
|
selector: "testAt",
|
2335
2773
|
fn: function (){
|
2336
2774
|
var self=this;
|
2337
|
-
smalltalk.
|
2338
|
-
return self}
|
2775
|
+
return smalltalk.withContext(function($ctx1) {
|
2776
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.PointTest)})}
|
2339
2777
|
}),
|
2340
2778
|
smalltalk.PointTest);
|
2341
2779
|
|
@@ -2345,9 +2783,9 @@ smalltalk.method({
|
|
2345
2783
|
selector: "testEgality",
|
2346
2784
|
fn: function (){
|
2347
2785
|
var self=this;
|
2348
|
-
smalltalk.
|
2349
|
-
|
2350
|
-
return self}
|
2786
|
+
return smalltalk.withContext(function($ctx1) {
|
2787
|
+
_st(self)._deny_(_st(_st((3)).__at((5))).__eq(_st((3)).__at((6))));
|
2788
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testEgality",{}, smalltalk.PointTest)})}
|
2351
2789
|
}),
|
2352
2790
|
smalltalk.PointTest);
|
2353
2791
|
|
@@ -2357,11 +2795,11 @@ smalltalk.method({
|
|
2357
2795
|
selector: "testTranslateBy",
|
2358
2796
|
fn: function (){
|
2359
2797
|
var self=this;
|
2360
|
-
smalltalk.
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
return self}
|
2798
|
+
return smalltalk.withContext(function($ctx1) {
|
2799
|
+
_st(self)._assert_equals_(_st((3)).__at((2)),_st(_st((3)).__at((3)))._translateBy_(_st((0)).__at(_st((1))._negated())));
|
2800
|
+
_st(self)._assert_equals_(_st((5)).__at((6)),_st(_st((3)).__at((3)))._translateBy_(_st((2)).__at((3))));
|
2801
|
+
_st(self)._assert_equals_(_st((0)).__at((3)),_st(_st((3)).__at((3)))._translateBy_(_st(_st((3))._negated()).__at((0))));
|
2802
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTranslateBy",{}, smalltalk.PointTest)})}
|
2365
2803
|
}),
|
2366
2804
|
smalltalk.PointTest);
|
2367
2805
|
|
@@ -2374,17 +2812,16 @@ smalltalk.method({
|
|
2374
2812
|
selector: "textNext",
|
2375
2813
|
fn: function (){
|
2376
2814
|
var self=this;
|
2377
|
-
smalltalk.
|
2378
|
-
var current;
|
2379
|
-
|
2380
|
-
next=smalltalk.send(smalltalk.send((smalltalk.Random || Random),"_new",[]),"_next",[]);
|
2815
|
+
return smalltalk.withContext(function($ctx1) {
|
2816
|
+
var current,next;
|
2817
|
+
return smalltalk.withContext(function($ctx2) {
|
2381
2818
|
next;
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
return
|
2386
|
-
})
|
2387
|
-
return self}
|
2819
|
+
_st(self)._assert_(_st(next).__gt_eq((0)));
|
2820
|
+
_st(self)._assert_(_st(next).__lt((1)));
|
2821
|
+
_st(self)._deny_(_st(current).__eq(next));
|
2822
|
+
return _st(next).__eq(current);
|
2823
|
+
}, function($ctx2) {$ctx2.fillBlock({current:current,next:next},$ctx1)})}));
|
2824
|
+
return self}, function($ctx1) {$ctx1.fill(self,"textNext",{}, smalltalk.RandomTest)})}
|
2388
2825
|
}),
|
2389
2826
|
smalltalk.RandomTest);
|
2390
2827
|
|
@@ -2398,15 +2835,15 @@ selector: "testAddRemove",
|
|
2398
2835
|
fn: function (){
|
2399
2836
|
var self=this;
|
2400
2837
|
var set;
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
return self}
|
2838
|
+
return smalltalk.withContext(function($ctx1) {
|
2839
|
+
_st(self)._assert_(_st(set)._isEmpty());
|
2840
|
+
_st(set)._add_((3));
|
2841
|
+
_st(self)._assert_(_st(set)._includes_((3)));
|
2842
|
+
_st(set)._add_((5));
|
2843
|
+
_st(self)._assert_(_st(set)._includes_((5)));
|
2844
|
+
_st(set)._remove_((3));
|
2845
|
+
_st(self)._deny_(_st(set)._includes_((3)));
|
2846
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAddRemove",{set:set}, smalltalk.SetTest)})}
|
2410
2847
|
}),
|
2411
2848
|
smalltalk.SetTest);
|
2412
2849
|
|
@@ -2416,10 +2853,10 @@ smalltalk.method({
|
|
2416
2853
|
selector: "testAt",
|
2417
2854
|
fn: function (){
|
2418
2855
|
var self=this;
|
2419
|
-
smalltalk.
|
2420
|
-
return smalltalk.
|
2421
|
-
}),(smalltalk.Error || Error)
|
2422
|
-
return self}
|
2856
|
+
return smalltalk.withContext(function($ctx1) {
|
2857
|
+
return smalltalk.withContext(function($ctx2) {
|
2858
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.Error || Error));
|
2859
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAt",{}, smalltalk.SetTest)})}
|
2423
2860
|
}),
|
2424
2861
|
smalltalk.SetTest);
|
2425
2862
|
|
@@ -2429,23 +2866,25 @@ smalltalk.method({
|
|
2429
2866
|
selector: "testPrintString",
|
2430
2867
|
fn: function (){
|
2431
2868
|
var self=this;
|
2432
|
-
var $1,$2;
|
2433
2869
|
var set;
|
2434
|
-
|
2435
|
-
smalltalk.
|
2436
|
-
|
2437
|
-
$1=
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2870
|
+
return smalltalk.withContext(function($ctx1) {
|
2871
|
+
set=_st((smalltalk.Set || Set))._new();
|
2872
|
+
_st(self)._assert_equals_("a Set ()",_st(set)._printString());
|
2873
|
+
$1=set;
|
2874
|
+
_st($1)._add_((1));
|
2875
|
+
$2=_st($1)._add_((3));
|
2876
|
+
_st(self)._assert_equals_("a Set (1 3)",_st(set)._printString());
|
2877
|
+
_st(set)._add_("foo");
|
2878
|
+
_st(self)._assert_equals_("a Set (1 3 'foo')",_st(set)._printString());
|
2879
|
+
$3=set;
|
2880
|
+
_st($3)._remove_((1));
|
2881
|
+
$4=_st($3)._remove_((3));
|
2882
|
+
_st(self)._assert_equals_("a Set ('foo')",_st(set)._printString());
|
2883
|
+
_st(set)._add_((3));
|
2884
|
+
_st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
|
2885
|
+
_st(set)._add_((3));
|
2886
|
+
_st(self)._assert_equals_("a Set ('foo' 3)",_st(set)._printString());
|
2887
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPrintString",{set:set}, smalltalk.SetTest)})}
|
2449
2888
|
}),
|
2450
2889
|
smalltalk.SetTest);
|
2451
2890
|
|
@@ -2455,10 +2894,10 @@ smalltalk.method({
|
|
2455
2894
|
selector: "testSize",
|
2456
2895
|
fn: function (){
|
2457
2896
|
var self=this;
|
2458
|
-
smalltalk.
|
2459
|
-
|
2460
|
-
|
2461
|
-
return self}
|
2897
|
+
return smalltalk.withContext(function($ctx1) {
|
2898
|
+
_st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (2), (3), (4)]))._size(),(4));
|
2899
|
+
_st(self)._assert_equals_(_st(_st((smalltalk.Set || Set))._withAll_([(1), (1), (1), (1)]))._size(),(1));
|
2900
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSize",{}, smalltalk.SetTest)})}
|
2462
2901
|
}),
|
2463
2902
|
smalltalk.SetTest);
|
2464
2903
|
|
@@ -2469,15 +2908,15 @@ selector: "testUnicity",
|
|
2469
2908
|
fn: function (){
|
2470
2909
|
var self=this;
|
2471
2910
|
var set;
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
return self}
|
2911
|
+
return smalltalk.withContext(function($ctx1) {
|
2912
|
+
_st(set)._add_((21));
|
2913
|
+
_st(set)._add_("hello");
|
2914
|
+
_st(set)._add_((21));
|
2915
|
+
_st(self)._assert_(_st(_st(set)._size()).__eq((2)));
|
2916
|
+
_st(set)._add_("hello");
|
2917
|
+
_st(self)._assert_(_st(_st(set)._size()).__eq((2)));
|
2918
|
+
_st(self)._assert_equals_(_st(set)._asArray(),[(21), "hello"]);
|
2919
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testUnicity",{set:set}, smalltalk.SetTest)})}
|
2481
2920
|
}),
|
2482
2921
|
smalltalk.SetTest);
|
2483
2922
|
|
@@ -2490,8 +2929,8 @@ smalltalk.method({
|
|
2490
2929
|
selector: "testCopying",
|
2491
2930
|
fn: function (){
|
2492
2931
|
var self=this;
|
2493
|
-
smalltalk.
|
2494
|
-
return self}
|
2932
|
+
return smalltalk.withContext(function($ctx1) {
|
2933
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCopying",{}, smalltalk.UndefinedTest)})}
|
2495
2934
|
}),
|
2496
2935
|
smalltalk.UndefinedTest);
|
2497
2936
|
|
@@ -2501,8 +2940,8 @@ smalltalk.method({
|
|
2501
2940
|
selector: "testDeepCopy",
|
2502
2941
|
fn: function (){
|
2503
2942
|
var self=this;
|
2504
|
-
smalltalk.
|
2505
|
-
return self}
|
2943
|
+
return smalltalk.withContext(function($ctx1) {
|
2944
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDeepCopy",{}, smalltalk.UndefinedTest)})}
|
2506
2945
|
}),
|
2507
2946
|
smalltalk.UndefinedTest);
|
2508
2947
|
|
@@ -2512,31 +2951,35 @@ smalltalk.method({
|
|
2512
2951
|
selector: "testIfNil",
|
2513
2952
|
fn: function (){
|
2514
2953
|
var self=this;
|
2515
|
-
|
2954
|
+
return smalltalk.withContext(function($ctx1) {
|
2955
|
+
$1=self;
|
2516
2956
|
if(($receiver = nil) == nil || $receiver == undefined){
|
2517
|
-
$
|
2957
|
+
$2=true;
|
2518
2958
|
} else {
|
2519
|
-
$
|
2959
|
+
$2=nil;
|
2520
2960
|
};
|
2521
|
-
|
2961
|
+
_st($1)._assert_equals_($2,true);
|
2962
|
+
$3=self;
|
2522
2963
|
if(($receiver = nil) == nil || $receiver == undefined){
|
2523
|
-
$
|
2964
|
+
$5=nil;
|
2524
2965
|
} else {
|
2525
|
-
$
|
2966
|
+
$5=true;
|
2526
2967
|
};
|
2527
|
-
|
2968
|
+
$4=_st($5).__eq(true);
|
2969
|
+
_st($3)._deny_($4);
|
2970
|
+
$6=self;
|
2528
2971
|
if(($receiver = nil) == nil || $receiver == undefined){
|
2529
|
-
$
|
2972
|
+
$7=true;
|
2530
2973
|
} else {
|
2531
|
-
$
|
2974
|
+
$7=false;
|
2532
2975
|
};
|
2533
|
-
|
2534
|
-
|
2535
|
-
return
|
2536
|
-
}),(function(){
|
2537
|
-
return
|
2538
|
-
})
|
2539
|
-
return self}
|
2976
|
+
_st($6)._assert_equals_($7,true);
|
2977
|
+
_st(self)._deny_(_st(_st(nil)._ifNotNil_ifNil_((function(){
|
2978
|
+
return smalltalk.withContext(function($ctx2) {
|
2979
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
|
2980
|
+
return smalltalk.withContext(function($ctx2) {
|
2981
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))).__eq(true));
|
2982
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIfNil",{}, smalltalk.UndefinedTest)})}
|
2540
2983
|
}),
|
2541
2984
|
smalltalk.UndefinedTest);
|
2542
2985
|
|
@@ -2546,9 +2989,9 @@ smalltalk.method({
|
|
2546
2989
|
selector: "testIsNil",
|
2547
2990
|
fn: function (){
|
2548
2991
|
var self=this;
|
2549
|
-
smalltalk.
|
2550
|
-
|
2551
|
-
return self}
|
2992
|
+
return smalltalk.withContext(function($ctx1) {
|
2993
|
+
_st(self)._deny_(_st(nil)._notNil());
|
2994
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testIsNil",{}, smalltalk.UndefinedTest)})}
|
2552
2995
|
}),
|
2553
2996
|
smalltalk.UndefinedTest);
|
2554
2997
|
|