resin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +52 -0
- data/amber/css/amber.css +519 -0
- data/amber/css/documentation.css +84 -0
- data/amber/css/profstef.css +75 -0
- data/amber/css/style.css +313 -0
- data/amber/images/amber.png +0 -0
- data/amber/images/amber_small.png +0 -0
- data/amber/images/off.png +0 -0
- data/amber/images/offHover.png +0 -0
- data/amber/images/presentation.png +0 -0
- data/amber/images/profstef.png +0 -0
- data/amber/images/sprite.png +0 -0
- data/amber/images/tinylogo.png +0 -0
- data/amber/images/twitterwall.png +0 -0
- data/amber/js/Additional-Examples.deploy.js +15 -0
- data/amber/js/Additional-Examples.js +21 -0
- data/amber/js/Benchfib.deploy.js +132 -0
- data/amber/js/Benchfib.js +167 -0
- data/amber/js/Canvas.deploy.js +1304 -0
- data/amber/js/Canvas.js +1885 -0
- data/amber/js/Compiler.deploy.js +1871 -0
- data/amber/js/Compiler.js +2616 -0
- data/amber/js/Documentation.deploy.js +961 -0
- data/amber/js/Documentation.js +1376 -0
- data/amber/js/Examples.deploy.js +53 -0
- data/amber/js/Examples.js +73 -0
- data/amber/js/IDE.deploy.js +3468 -0
- data/amber/js/IDE.js +4883 -0
- data/amber/js/Kernel-Announcements.deploy.js +107 -0
- data/amber/js/Kernel-Announcements.js +152 -0
- data/amber/js/Kernel-Classes.deploy.js +675 -0
- data/amber/js/Kernel-Classes.js +956 -0
- data/amber/js/Kernel-Collections.deploy.js +3273 -0
- data/amber/js/Kernel-Collections.js +4644 -0
- data/amber/js/Kernel-Exceptions.deploy.js +244 -0
- data/amber/js/Kernel-Exceptions.js +349 -0
- data/amber/js/Kernel-Methods.deploy.js +510 -0
- data/amber/js/Kernel-Methods.js +739 -0
- data/amber/js/Kernel-Objects.deploy.js +2698 -0
- data/amber/js/Kernel-Objects.js +3858 -0
- data/amber/js/Kernel-Tests.deploy.js +1419 -0
- data/amber/js/Kernel-Tests.js +1929 -0
- data/amber/js/Kernel-Transcript.deploy.js +142 -0
- data/amber/js/Kernel-Transcript.js +202 -0
- data/amber/js/SUnit.deploy.js +351 -0
- data/amber/js/SUnit.js +501 -0
- data/amber/js/amber.js +250 -0
- data/amber/js/boot.js +587 -0
- data/amber/js/compat.js +22 -0
- data/amber/js/init.js +8 -0
- data/amber/js/lib/CodeMirror/LICENSE +19 -0
- data/amber/js/lib/CodeMirror/amber.css +21 -0
- data/amber/js/lib/CodeMirror/codemirror.css +67 -0
- data/amber/js/lib/CodeMirror/codemirror.js +2144 -0
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -0
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
- data/amber/js/lib/jQuery/jquery.textarea.js +267 -0
- data/amber/js/lib/peg-0.6.2.min.js +2 -0
- data/amber/js/lib/showdown.js +419 -0
- data/amber/js/parser.js +4005 -0
- data/amber/js/parser.pegjs +220 -0
- data/amber/st/Benchfib.st +124 -0
- data/amber/st/Canvas.st +556 -0
- data/amber/st/Compiler.st +1425 -0
- data/amber/st/Documentation.st +758 -0
- data/amber/st/Examples.st +38 -0
- data/amber/st/IDE.st +2336 -0
- data/amber/st/Kernel-Announcements.st +61 -0
- data/amber/st/Kernel-Classes.st +403 -0
- data/amber/st/Kernel-Collections.st +1673 -0
- data/amber/st/Kernel-Exceptions.st +124 -0
- data/amber/st/Kernel-Methods.st +287 -0
- data/amber/st/Kernel-Objects.st +1489 -0
- data/amber/st/Kernel-Tests.st +892 -0
- data/amber/st/Kernel-Transcript.st +70 -0
- data/amber/st/SUnit.st +172 -0
- data/bin/runresin +12 -0
- data/lib/resin.rb +0 -0
- data/lib/resin/app/app.rb +121 -0
- data/lib/resin/app/views/index.haml +10 -0
- metadata +216 -0
@@ -0,0 +1,1419 @@
|
|
1
|
+
smalltalk.addPackage('Kernel-Tests', {});
|
2
|
+
smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
unescape('_testJoin'),
|
5
|
+
smalltalk.method({
|
6
|
+
selector: unescape('testJoin'),
|
7
|
+
fn: function (){
|
8
|
+
var self=this;
|
9
|
+
smalltalk.send(self, "_assert_equals_", [unescape("hello%2Cworld"), smalltalk.send(unescape("%2C"), "_join_", [["hello", "world"]])]);
|
10
|
+
return self;}
|
11
|
+
}),
|
12
|
+
smalltalk.StringTest);
|
13
|
+
|
14
|
+
smalltalk.addMethod(
|
15
|
+
unescape('_testStreamContents'),
|
16
|
+
smalltalk.method({
|
17
|
+
selector: unescape('testStreamContents'),
|
18
|
+
fn: function (){
|
19
|
+
var self=this;
|
20
|
+
smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["hello"]);smalltalk.send($rec, "_space", []);return smalltalk.send($rec, "_nextPutAll_", ["world"]);})(aStream);})])]);
|
21
|
+
return self;}
|
22
|
+
}),
|
23
|
+
smalltalk.StringTest);
|
24
|
+
|
25
|
+
smalltalk.addMethod(
|
26
|
+
unescape('_testIncludesSubString'),
|
27
|
+
smalltalk.method({
|
28
|
+
selector: unescape('testIncludesSubString'),
|
29
|
+
fn: function (){
|
30
|
+
var self=this;
|
31
|
+
smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
|
32
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
|
33
|
+
return self;}
|
34
|
+
}),
|
35
|
+
smalltalk.StringTest);
|
36
|
+
|
37
|
+
smalltalk.addMethod(
|
38
|
+
unescape('_testEquality'),
|
39
|
+
smalltalk.method({
|
40
|
+
selector: unescape('testEquality'),
|
41
|
+
fn: function (){
|
42
|
+
var self=this;
|
43
|
+
smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", ["hello"])]);
|
44
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", ["world"])]);
|
45
|
+
smalltalk.send(self, "_assert_", [smalltalk.send("hello", "__eq", [smalltalk.send("hello", "_yourself", [])])]);
|
46
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_yourself", []), "__eq", ["hello"])]);
|
47
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
|
48
|
+
return self;}
|
49
|
+
}),
|
50
|
+
smalltalk.StringTest);
|
51
|
+
|
52
|
+
smalltalk.addMethod(
|
53
|
+
unescape('_testCopyWithoutAll'),
|
54
|
+
smalltalk.method({
|
55
|
+
selector: unescape('testCopyWithoutAll'),
|
56
|
+
fn: function (){
|
57
|
+
var self=this;
|
58
|
+
smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send(unescape("*hello*%20*world*"), "_copyWithoutAll_", [unescape("*")])]);
|
59
|
+
return self;}
|
60
|
+
}),
|
61
|
+
smalltalk.StringTest);
|
62
|
+
|
63
|
+
smalltalk.addMethod(
|
64
|
+
unescape('_testAt'),
|
65
|
+
smalltalk.method({
|
66
|
+
selector: unescape('testAt'),
|
67
|
+
fn: function (){
|
68
|
+
var self=this;
|
69
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(1)]), "__eq", ["h"])]);
|
70
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_", [(5)]), "__eq", ["o"])]);
|
71
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
|
72
|
+
return self;}
|
73
|
+
}),
|
74
|
+
smalltalk.StringTest);
|
75
|
+
|
76
|
+
smalltalk.addMethod(
|
77
|
+
unescape('_testAtPut'),
|
78
|
+
smalltalk.method({
|
79
|
+
selector: unescape('testAtPut'),
|
80
|
+
fn: function (){
|
81
|
+
var self=this;
|
82
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
|
83
|
+
return self;}
|
84
|
+
}),
|
85
|
+
smalltalk.StringTest);
|
86
|
+
|
87
|
+
smalltalk.addMethod(
|
88
|
+
unescape('_testSize'),
|
89
|
+
smalltalk.method({
|
90
|
+
selector: unescape('testSize'),
|
91
|
+
fn: function (){
|
92
|
+
var self=this;
|
93
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
|
94
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
|
95
|
+
return self;}
|
96
|
+
}),
|
97
|
+
smalltalk.StringTest);
|
98
|
+
|
99
|
+
smalltalk.addMethod(
|
100
|
+
unescape('_testAddRemove'),
|
101
|
+
smalltalk.method({
|
102
|
+
selector: unescape('testAddRemove'),
|
103
|
+
fn: function (){
|
104
|
+
var self=this;
|
105
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
|
106
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
|
107
|
+
return self;}
|
108
|
+
}),
|
109
|
+
smalltalk.StringTest);
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
114
|
+
smalltalk.addMethod(
|
115
|
+
unescape('_testPrintString'),
|
116
|
+
smalltalk.method({
|
117
|
+
selector: unescape('testPrintString'),
|
118
|
+
fn: function (){
|
119
|
+
var self=this;
|
120
|
+
smalltalk.send(self, "_assert_equals_", [unescape("a%20Dictionary%28%27firstname%27%20-%3E%20%27James%27%20%2C%20%27lastname%27%20-%3E%20%27Bond%27%29"), (function($rec){smalltalk.send($rec, "_at_put_", ["firstname", "James"]);smalltalk.send($rec, "_at_put_", ["lastname", "Bond"]);return smalltalk.send($rec, "_printString", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []))]);
|
121
|
+
return self;}
|
122
|
+
}),
|
123
|
+
smalltalk.DictionaryTest);
|
124
|
+
|
125
|
+
smalltalk.addMethod(
|
126
|
+
unescape('_testEquality'),
|
127
|
+
smalltalk.method({
|
128
|
+
selector: unescape('testEquality'),
|
129
|
+
fn: function (){
|
130
|
+
var self=this;
|
131
|
+
var d1=nil;
|
132
|
+
var d2=nil;
|
133
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])])]);
|
134
|
+
(d1=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
135
|
+
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
136
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(d1, "__eq", [d2])]);
|
137
|
+
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (3)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
138
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
139
|
+
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
140
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
141
|
+
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
142
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
143
|
+
return self;}
|
144
|
+
}),
|
145
|
+
smalltalk.DictionaryTest);
|
146
|
+
|
147
|
+
smalltalk.addMethod(
|
148
|
+
unescape('_testDynamicDictionaries'),
|
149
|
+
smalltalk.method({
|
150
|
+
selector: unescape('testDynamicDictionaries'),
|
151
|
+
fn: function (){
|
152
|
+
var self=this;
|
153
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.HashedCollection._fromPairs_([smalltalk.send("hello", "__minus_gt", [(1)])]), "_asDictionary", []), "__eq", [smalltalk.send((smalltalk.Dictionary || Dictionary), "_with_", [smalltalk.send("hello", "__minus_gt", [(1)])])])]);
|
154
|
+
return self;}
|
155
|
+
}),
|
156
|
+
smalltalk.DictionaryTest);
|
157
|
+
|
158
|
+
smalltalk.addMethod(
|
159
|
+
unescape('_testAccessing'),
|
160
|
+
smalltalk.method({
|
161
|
+
selector: unescape('testAccessing'),
|
162
|
+
fn: function (){
|
163
|
+
var self=this;
|
164
|
+
var d=nil;
|
165
|
+
(d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
|
166
|
+
smalltalk.send(d, "_at_put_", ["hello", "world"]);
|
167
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", ["hello"]), "__eq", ["world"])]);
|
168
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["hello", (function(){return nil;})]), "__eq", ["world"])]);
|
169
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(d, "_at_ifAbsent_", ["foo", (function(){return nil;})]), "__eq", ["world"])]);
|
170
|
+
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
171
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [(1)]), "__eq", [(2)])]);
|
172
|
+
smalltalk.send(d, "_at_put_", [smalltalk.send((1), "__at", [(3)]), (3)]);
|
173
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_at_", [smalltalk.send((1), "__at", [(3)])]), "__eq", [(3)])]);
|
174
|
+
return self;}
|
175
|
+
}),
|
176
|
+
smalltalk.DictionaryTest);
|
177
|
+
|
178
|
+
smalltalk.addMethod(
|
179
|
+
unescape('_testSize'),
|
180
|
+
smalltalk.method({
|
181
|
+
selector: unescape('testSize'),
|
182
|
+
fn: function (){
|
183
|
+
var self=this;
|
184
|
+
var d=nil;
|
185
|
+
(d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
|
186
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(0)])]);
|
187
|
+
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
188
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
|
189
|
+
smalltalk.send(d, "_at_put_", [(2), (3)]);
|
190
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
|
191
|
+
return self;}
|
192
|
+
}),
|
193
|
+
smalltalk.DictionaryTest);
|
194
|
+
|
195
|
+
smalltalk.addMethod(
|
196
|
+
unescape('_testValues'),
|
197
|
+
smalltalk.method({
|
198
|
+
selector: unescape('testValues'),
|
199
|
+
fn: function (){
|
200
|
+
var self=this;
|
201
|
+
var d=nil;
|
202
|
+
(d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
|
203
|
+
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
204
|
+
smalltalk.send(d, "_at_put_", [(2), (3)]);
|
205
|
+
smalltalk.send(d, "_at_put_", [(3), (4)]);
|
206
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
|
207
|
+
return self;}
|
208
|
+
}),
|
209
|
+
smalltalk.DictionaryTest);
|
210
|
+
|
211
|
+
smalltalk.addMethod(
|
212
|
+
unescape('_testKeys'),
|
213
|
+
smalltalk.method({
|
214
|
+
selector: unescape('testKeys'),
|
215
|
+
fn: function (){
|
216
|
+
var self=this;
|
217
|
+
var d=nil;
|
218
|
+
(d=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
|
219
|
+
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
220
|
+
smalltalk.send(d, "_at_put_", [(2), (3)]);
|
221
|
+
smalltalk.send(d, "_at_put_", [(3), (4)]);
|
222
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
|
223
|
+
return self;}
|
224
|
+
}),
|
225
|
+
smalltalk.DictionaryTest);
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
smalltalk.addClass('BooleanTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
230
|
+
smalltalk.addMethod(
|
231
|
+
unescape('_testLogic'),
|
232
|
+
smalltalk.method({
|
233
|
+
selector: unescape('testLogic'),
|
234
|
+
fn: function (){
|
235
|
+
var self=this;
|
236
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [true])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_&", [false])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_&", [false])]);})(self);
|
237
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [true])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_|", [false])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [true])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_|", [false])]);})(self);
|
238
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_&", [(1) > (0)])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [false])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_&", [(1) > (2)])]);})(self);
|
239
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_|", [(1) > (0)])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [false])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_|", [(1) > (2)])]);})(self);
|
240
|
+
return self;}
|
241
|
+
}),
|
242
|
+
smalltalk.BooleanTest);
|
243
|
+
|
244
|
+
smalltalk.addMethod(
|
245
|
+
unescape('_testEquality'),
|
246
|
+
smalltalk.method({
|
247
|
+
selector: unescape('testEquality'),
|
248
|
+
fn: function (){
|
249
|
+
var self=this;
|
250
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
|
251
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
|
252
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [false])]);
|
253
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [""])]);
|
254
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(true, "__eq", [true])]);
|
255
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [true])]);
|
256
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(true, "__eq", [false])]);
|
257
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(false, "__eq", [false])]);
|
258
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [true])]);
|
259
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(true, "_yourself", []), "__eq", [smalltalk.send(true, "_yourself", [])])]);
|
260
|
+
return self;}
|
261
|
+
}),
|
262
|
+
smalltalk.BooleanTest);
|
263
|
+
|
264
|
+
smalltalk.addMethod(
|
265
|
+
unescape('_testLogicKeywords'),
|
266
|
+
smalltalk.method({
|
267
|
+
selector: unescape('testLogicKeywords'),
|
268
|
+
fn: function (){
|
269
|
+
var self=this;
|
270
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return true;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(true, "_and_", [(function(){return false;})])]);smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_and_", [(function(){return false;})])]);})(self);
|
271
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return true;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_or_", [(function(){return false;})])]);smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return true;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send(false, "_or_", [(function(){return false;})])]);})(self);
|
272
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(true, "_and_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return false;})])]);return smalltalk.send($rec, "_deny_", [smalltalk.send((1) > (0), "_and_", [(function(){return (1) > (2);})])]);})(self);
|
273
|
+
(function($rec){smalltalk.send($rec, "_assert_", [smalltalk.send(false, "_or_", [(function(){return (1) > (0);})])]);smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return false;})])]);return smalltalk.send($rec, "_assert_", [smalltalk.send((1) > (0), "_or_", [(function(){return (1) > (2);})])]);})(self);
|
274
|
+
return self;}
|
275
|
+
}),
|
276
|
+
smalltalk.BooleanTest);
|
277
|
+
|
278
|
+
smalltalk.addMethod(
|
279
|
+
unescape('_testIfTrueIfFalse'),
|
280
|
+
smalltalk.method({
|
281
|
+
selector: unescape('testIfTrueIfFalse'),
|
282
|
+
fn: function (){
|
283
|
+
var self=this;
|
284
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
|
285
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", [nil])]);
|
286
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return "alternative block";})])), "__eq", [nil])]);
|
287
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return "alternative block";})])), "__eq", ["alternative block"])]);
|
288
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
|
289
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = false).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
|
290
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block"])]);
|
291
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = true).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return "alternative block";})() : (function(){return "alternative block2";})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return "alternative block";}), (function(){return "alternative block2";})])), "__eq", ["alternative block2"])]);
|
292
|
+
return self;}
|
293
|
+
}),
|
294
|
+
smalltalk.BooleanTest);
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
299
|
+
smalltalk.addMethod(
|
300
|
+
unescape('_testPrintShowingDecimalPlaces'),
|
301
|
+
smalltalk.method({
|
302
|
+
selector: unescape('testPrintShowingDecimalPlaces'),
|
303
|
+
fn: function (){
|
304
|
+
var self=this;
|
305
|
+
smalltalk.send(self, "_assert_equals_", ["23.00", smalltalk.send((23), "_printShowingDecimalPlaces_", [(2)])]);
|
306
|
+
smalltalk.send(self, "_assert_equals_", ["23.57", smalltalk.send((23.5698), "_printShowingDecimalPlaces_", [(2)])]);
|
307
|
+
smalltalk.send(self, "_assert_equals_", [unescape("-234.56700"), smalltalk.send(smalltalk.send((234.567), "_negated", []), "_printShowingDecimalPlaces_", [(5)])]);
|
308
|
+
smalltalk.send(self, "_assert_equals_", ["23", smalltalk.send((23.4567), "_printShowingDecimalPlaces_", [(0)])]);
|
309
|
+
smalltalk.send(self, "_assert_equals_", ["24", smalltalk.send((23.5567), "_printShowingDecimalPlaces_", [(0)])]);
|
310
|
+
smalltalk.send(self, "_assert_equals_", [unescape("-23"), smalltalk.send(smalltalk.send((23.4567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
|
311
|
+
smalltalk.send(self, "_assert_equals_", [unescape("-24"), smalltalk.send(smalltalk.send((23.5567), "_negated", []), "_printShowingDecimalPlaces_", [(0)])]);
|
312
|
+
smalltalk.send(self, "_assert_equals_", ["100000000.0", smalltalk.send((100000000), "_printShowingDecimalPlaces_", [(1)])]);
|
313
|
+
smalltalk.send(self, "_assert_equals_", ["0.98000", smalltalk.send((0.98), "_printShowingDecimalPlaces_", [(5)])]);
|
314
|
+
smalltalk.send(self, "_assert_equals_", [unescape("-0.98"), smalltalk.send(smalltalk.send((0.98), "_negated", []), "_printShowingDecimalPlaces_", [(2)])]);
|
315
|
+
smalltalk.send(self, "_assert_equals_", ["2.57", smalltalk.send((2.567), "_printShowingDecimalPlaces_", [(2)])]);
|
316
|
+
smalltalk.send(self, "_assert_equals_", [unescape("-2.57"), smalltalk.send((-2.567), "_printShowingDecimalPlaces_", [(2)])]);
|
317
|
+
smalltalk.send(self, "_assert_equals_", ["0.00", smalltalk.send((0), "_printShowingDecimalPlaces_", [(2)])]);
|
318
|
+
return self;}
|
319
|
+
}),
|
320
|
+
smalltalk.NumberTest);
|
321
|
+
|
322
|
+
smalltalk.addMethod(
|
323
|
+
unescape('_testEquality'),
|
324
|
+
smalltalk.method({
|
325
|
+
selector: unescape('testEquality'),
|
326
|
+
fn: function (){
|
327
|
+
var self=this;
|
328
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [(1)])]);
|
329
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq", [(0)])]);
|
330
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq", [(0)])]);
|
331
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [(1)])]);
|
332
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq", [smalltalk.send((1), "_yourself", [])])]);
|
333
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq", [smalltalk.send((1), "_yourself", [])])]);
|
334
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [false])]);
|
335
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(false, "__eq", [(0)])]);
|
336
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("", "__eq", [(0)])]);
|
337
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((0), "__eq", [""])]);
|
338
|
+
return self;}
|
339
|
+
}),
|
340
|
+
smalltalk.NumberTest);
|
341
|
+
|
342
|
+
smalltalk.addMethod(
|
343
|
+
unescape('_testArithmetic'),
|
344
|
+
smalltalk.method({
|
345
|
+
selector: unescape('testArithmetic'),
|
346
|
+
fn: function (){
|
347
|
+
var self=this;
|
348
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1.5) + (1), "__eq", [(2.5)])]);
|
349
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((2) - (1), "__eq", [(1)])]);
|
350
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((-2) - (1), "__eq", [(-3)])]);
|
351
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((12) / (2), "__eq", [(6)])]);
|
352
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((3) * (4), "__eq", [(12)])]);
|
353
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(((($receiver = (1) + (2)).klass === smalltalk.Number) ? $receiver *(3) : smalltalk.send($receiver, "__star", [(3)])), "__eq", [(9)])]);
|
354
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1) + (2) * (3), "__eq", [(7)])]);
|
355
|
+
return self;}
|
356
|
+
}),
|
357
|
+
smalltalk.NumberTest);
|
358
|
+
|
359
|
+
smalltalk.addMethod(
|
360
|
+
unescape('_testRounded'),
|
361
|
+
smalltalk.method({
|
362
|
+
selector: unescape('testRounded'),
|
363
|
+
fn: function (){
|
364
|
+
var self=this;
|
365
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_rounded", []), "__eq", [(3)])]);
|
366
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_rounded", []), "__eq", [(3)])]);
|
367
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_rounded", []), "__eq", [(4)])]);
|
368
|
+
return self;}
|
369
|
+
}),
|
370
|
+
smalltalk.NumberTest);
|
371
|
+
|
372
|
+
smalltalk.addMethod(
|
373
|
+
unescape('_testNegated'),
|
374
|
+
smalltalk.method({
|
375
|
+
selector: unescape('testNegated'),
|
376
|
+
fn: function (){
|
377
|
+
var self=this;
|
378
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_negated", []), "__eq", [(-3)])]);
|
379
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((-3), "_negated", []), "__eq", [(3)])]);
|
380
|
+
return self;}
|
381
|
+
}),
|
382
|
+
smalltalk.NumberTest);
|
383
|
+
|
384
|
+
smalltalk.addMethod(
|
385
|
+
unescape('_testComparison'),
|
386
|
+
smalltalk.method({
|
387
|
+
selector: unescape('testComparison'),
|
388
|
+
fn: function (){
|
389
|
+
var self=this;
|
390
|
+
smalltalk.send(self, "_assert_", [(3) > (2)]);
|
391
|
+
smalltalk.send(self, "_assert_", [(2) < (3)]);
|
392
|
+
smalltalk.send(self, "_deny_", [(3) < (2)]);
|
393
|
+
smalltalk.send(self, "_deny_", [(2) > (3)]);
|
394
|
+
smalltalk.send(self, "_assert_", [(3) >= (3)]);
|
395
|
+
smalltalk.send(self, "_assert_", [(3.1) >= (3)]);
|
396
|
+
smalltalk.send(self, "_assert_", [(3) <= (3)]);
|
397
|
+
smalltalk.send(self, "_assert_", [(3) <= (3.1)]);
|
398
|
+
return self;}
|
399
|
+
}),
|
400
|
+
smalltalk.NumberTest);
|
401
|
+
|
402
|
+
smalltalk.addMethod(
|
403
|
+
unescape('_testTruncated'),
|
404
|
+
smalltalk.method({
|
405
|
+
selector: unescape('testTruncated'),
|
406
|
+
fn: function (){
|
407
|
+
var self=this;
|
408
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "_truncated", []), "__eq", [(3)])]);
|
409
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.212), "_truncated", []), "__eq", [(3)])]);
|
410
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3.51), "_truncated", []), "__eq", [(3)])]);
|
411
|
+
return self;}
|
412
|
+
}),
|
413
|
+
smalltalk.NumberTest);
|
414
|
+
|
415
|
+
smalltalk.addMethod(
|
416
|
+
unescape('_testCopying'),
|
417
|
+
smalltalk.method({
|
418
|
+
selector: unescape('testCopying'),
|
419
|
+
fn: function (){
|
420
|
+
var self=this;
|
421
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_copy", []), "__eq_eq", [(1)])]);
|
422
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_deepCopy", []), "__eq_eq", [(1)])]);
|
423
|
+
return self;}
|
424
|
+
}),
|
425
|
+
smalltalk.NumberTest);
|
426
|
+
|
427
|
+
smalltalk.addMethod(
|
428
|
+
unescape('_testMinMax'),
|
429
|
+
smalltalk.method({
|
430
|
+
selector: unescape('testMinMax'),
|
431
|
+
fn: function (){
|
432
|
+
var self=this;
|
433
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_max_", [(5)]), (5)]);
|
434
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((2), "_min_", [(5)]), (2)]);
|
435
|
+
return self;}
|
436
|
+
}),
|
437
|
+
smalltalk.NumberTest);
|
438
|
+
|
439
|
+
smalltalk.addMethod(
|
440
|
+
unescape('_testIdentity'),
|
441
|
+
smalltalk.method({
|
442
|
+
selector: unescape('testIdentity'),
|
443
|
+
fn: function (){
|
444
|
+
var self=this;
|
445
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [(1)])]);
|
446
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((0), "__eq_eq", [(0)])]);
|
447
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(0)])]);
|
448
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [(1)])]);
|
449
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((1), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
|
450
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((1), "_yourself", []), "__eq_eq", [smalltalk.send((1), "_yourself", [])])]);
|
451
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((1), "__eq_eq", [(2)])]);
|
452
|
+
return self;}
|
453
|
+
}),
|
454
|
+
smalltalk.NumberTest);
|
455
|
+
|
456
|
+
smalltalk.addMethod(
|
457
|
+
unescape('_testSqrt'),
|
458
|
+
smalltalk.method({
|
459
|
+
selector: unescape('testSqrt'),
|
460
|
+
fn: function (){
|
461
|
+
var self=this;
|
462
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_sqrt", []), "__eq", [(2)])]);
|
463
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((16), "_sqrt", []), "__eq", [(4)])]);
|
464
|
+
return self;}
|
465
|
+
}),
|
466
|
+
smalltalk.NumberTest);
|
467
|
+
|
468
|
+
smalltalk.addMethod(
|
469
|
+
unescape('_testSquared'),
|
470
|
+
smalltalk.method({
|
471
|
+
selector: unescape('testSquared'),
|
472
|
+
fn: function (){
|
473
|
+
var self=this;
|
474
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((4), "_squared", []), "__eq", [(16)])]);
|
475
|
+
return self;}
|
476
|
+
}),
|
477
|
+
smalltalk.NumberTest);
|
478
|
+
|
479
|
+
smalltalk.addMethod(
|
480
|
+
unescape('_testTimesRepeat'),
|
481
|
+
smalltalk.method({
|
482
|
+
selector: unescape('testTimesRepeat'),
|
483
|
+
fn: function (){
|
484
|
+
var self=this;
|
485
|
+
var i=nil;
|
486
|
+
(i=(0));
|
487
|
+
smalltalk.send((0), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
|
488
|
+
smalltalk.send(self, "_assert_equals_", [i, (0)]);
|
489
|
+
smalltalk.send((5), "_timesRepeat_", [(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})]);
|
490
|
+
smalltalk.send(self, "_assert_equals_", [i, (5)]);
|
491
|
+
return self;}
|
492
|
+
}),
|
493
|
+
smalltalk.NumberTest);
|
494
|
+
|
495
|
+
smalltalk.addMethod(
|
496
|
+
unescape('_testTo'),
|
497
|
+
smalltalk.method({
|
498
|
+
selector: unescape('testTo'),
|
499
|
+
fn: function (){
|
500
|
+
var self=this;
|
501
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((1), "_to_", [(5)]), [(1), (2), (3), (4), (5)]]);
|
502
|
+
return self;}
|
503
|
+
}),
|
504
|
+
smalltalk.NumberTest);
|
505
|
+
|
506
|
+
smalltalk.addMethod(
|
507
|
+
unescape('_testToBy'),
|
508
|
+
smalltalk.method({
|
509
|
+
selector: unescape('testToBy'),
|
510
|
+
fn: function (){
|
511
|
+
var self=this;
|
512
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((0), "_to_by_", [(6), (2)]), [(0), (2), (4), (6)]]);
|
513
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send((1), "_to_by_", [(4), (0)]);}), (smalltalk.Error || Error)]);
|
514
|
+
return self;}
|
515
|
+
}),
|
516
|
+
smalltalk.NumberTest);
|
517
|
+
|
518
|
+
|
519
|
+
|
520
|
+
smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
521
|
+
smalltalk.addMethod(
|
522
|
+
unescape('_jsObject'),
|
523
|
+
smalltalk.method({
|
524
|
+
selector: unescape('jsObject'),
|
525
|
+
fn: function (){
|
526
|
+
var self=this;
|
527
|
+
return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
|
528
|
+
return self;}
|
529
|
+
}),
|
530
|
+
smalltalk.JSObjectProxyTest);
|
531
|
+
|
532
|
+
smalltalk.addMethod(
|
533
|
+
unescape('_testMethodWithArguments'),
|
534
|
+
smalltalk.method({
|
535
|
+
selector: unescape('testMethodWithArguments'),
|
536
|
+
fn: function (){
|
537
|
+
var self=this;
|
538
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
|
539
|
+
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["amber"]);
|
540
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
|
541
|
+
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amber"]);
|
542
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_hasClass_", ["amber"])]);
|
543
|
+
return self;}
|
544
|
+
}),
|
545
|
+
smalltalk.JSObjectProxyTest);
|
546
|
+
|
547
|
+
smalltalk.addMethod(
|
548
|
+
unescape('_testYourself'),
|
549
|
+
smalltalk.method({
|
550
|
+
selector: unescape('testYourself'),
|
551
|
+
fn: function (){
|
552
|
+
var self=this;
|
553
|
+
var body=nil;
|
554
|
+
(body=(function($rec){smalltalk.send($rec, "_addClass_", ["amber"]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send("body", "_asJQuery", [])));
|
555
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
|
556
|
+
smalltalk.send(body, "_removeClass_", ["amber"]);
|
557
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
|
558
|
+
return self;}
|
559
|
+
}),
|
560
|
+
smalltalk.JSObjectProxyTest);
|
561
|
+
|
562
|
+
smalltalk.addMethod(
|
563
|
+
unescape('_testPropertyThatReturnsEmptyString'),
|
564
|
+
smalltalk.method({
|
565
|
+
selector: unescape('testPropertyThatReturnsEmptyString'),
|
566
|
+
fn: function (){
|
567
|
+
var self=this;
|
568
|
+
document.location.hash = '';
|
569
|
+
smalltalk.send(self, "_assert_equals_", ["", smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
|
570
|
+
smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", ["test"]);
|
571
|
+
smalltalk.send(self, "_assert_equals_", [unescape("%23test"), smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", [])]);
|
572
|
+
return self;}
|
573
|
+
}),
|
574
|
+
smalltalk.JSObjectProxyTest);
|
575
|
+
|
576
|
+
smalltalk.addMethod(
|
577
|
+
unescape('_testDNU'),
|
578
|
+
smalltalk.method({
|
579
|
+
selector: unescape('testDNU'),
|
580
|
+
fn: function (){
|
581
|
+
var self=this;
|
582
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
|
583
|
+
return self;}
|
584
|
+
}),
|
585
|
+
smalltalk.JSObjectProxyTest);
|
586
|
+
|
587
|
+
smalltalk.addMethod(
|
588
|
+
unescape('_testMessageSend'),
|
589
|
+
smalltalk.method({
|
590
|
+
selector: unescape('testMessageSend'),
|
591
|
+
fn: function (){
|
592
|
+
var self=this;
|
593
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
|
594
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
|
595
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
|
596
|
+
return self;}
|
597
|
+
}),
|
598
|
+
smalltalk.JSObjectProxyTest);
|
599
|
+
|
600
|
+
smalltalk.addMethod(
|
601
|
+
unescape('_testPrinting'),
|
602
|
+
smalltalk.method({
|
603
|
+
selector: unescape('testPrinting'),
|
604
|
+
fn: function (){
|
605
|
+
var self=this;
|
606
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", [unescape("%5Bobject%20Object%5D")])]);
|
607
|
+
return self;}
|
608
|
+
}),
|
609
|
+
smalltalk.JSObjectProxyTest);
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
|
614
|
+
smalltalk.addMethod(
|
615
|
+
unescape('_setUp'),
|
616
|
+
smalltalk.method({
|
617
|
+
selector: unescape('setUp'),
|
618
|
+
fn: function (){
|
619
|
+
var self=this;
|
620
|
+
(self['@backUpCommitPathJs']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathJs", []));
|
621
|
+
(self['@backUpCommitPathSt']=smalltalk.send((smalltalk.Package || Package), "_defaultCommitPathSt", []));
|
622
|
+
smalltalk.send((smalltalk.Package || Package), "_resetCommitPaths", []);
|
623
|
+
(self['@zorkPackage']=smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_new", []), "_name_", ["Zork"]));
|
624
|
+
(self['@grulPackage']=(function($rec){smalltalk.send($rec, "_name_", ["Grul"]);smalltalk.send($rec, "_commitPathJs_", [unescape("server/grul/js")]);smalltalk.send($rec, "_commitPathSt_", [unescape("grul/st")]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Package || Package), "_new", [])));
|
625
|
+
return self;}
|
626
|
+
}),
|
627
|
+
smalltalk.PackageTest);
|
628
|
+
|
629
|
+
smalltalk.addMethod(
|
630
|
+
unescape('_tearDown'),
|
631
|
+
smalltalk.method({
|
632
|
+
selector: unescape('tearDown'),
|
633
|
+
fn: function (){
|
634
|
+
var self=this;
|
635
|
+
(function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [self['@backUpCommitPathJs']]);return smalltalk.send($rec, "_defaultCommitPathSt_", [self['@backUpCommitPathSt']]);})((smalltalk.Package || Package));
|
636
|
+
return self;}
|
637
|
+
}),
|
638
|
+
smalltalk.PackageTest);
|
639
|
+
|
640
|
+
smalltalk.addMethod(
|
641
|
+
unescape('_testGrulCommitPathStShouldBeGrulSt'),
|
642
|
+
smalltalk.method({
|
643
|
+
selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
|
644
|
+
fn: function (){
|
645
|
+
var self=this;
|
646
|
+
smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
|
647
|
+
return self;}
|
648
|
+
}),
|
649
|
+
smalltalk.PackageTest);
|
650
|
+
|
651
|
+
smalltalk.addMethod(
|
652
|
+
unescape('_testZorkCommitPathStShouldBeSt'),
|
653
|
+
smalltalk.method({
|
654
|
+
selector: unescape('testZorkCommitPathStShouldBeSt'),
|
655
|
+
fn: function (){
|
656
|
+
var self=this;
|
657
|
+
smalltalk.send(self, "_assert_equals_", ["st", smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
|
658
|
+
return self;}
|
659
|
+
}),
|
660
|
+
smalltalk.PackageTest);
|
661
|
+
|
662
|
+
smalltalk.addMethod(
|
663
|
+
unescape('_testZorkCommitPathJsShouldBeJs'),
|
664
|
+
smalltalk.method({
|
665
|
+
selector: unescape('testZorkCommitPathJsShouldBeJs'),
|
666
|
+
fn: function (){
|
667
|
+
var self=this;
|
668
|
+
smalltalk.send(self, "_assert_equals_", ["js", smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
|
669
|
+
return self;}
|
670
|
+
}),
|
671
|
+
smalltalk.PackageTest);
|
672
|
+
|
673
|
+
smalltalk.addMethod(
|
674
|
+
unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
|
675
|
+
smalltalk.method({
|
676
|
+
selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
|
677
|
+
fn: function (){
|
678
|
+
var self=this;
|
679
|
+
smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
|
680
|
+
return self;}
|
681
|
+
}),
|
682
|
+
smalltalk.PackageTest);
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
smalltalk.addClass('PackageWithDefaultCommitPathChangedTest', smalltalk.PackageTest, [], 'Kernel-Tests');
|
687
|
+
smalltalk.addMethod(
|
688
|
+
unescape('_setUp'),
|
689
|
+
smalltalk.method({
|
690
|
+
selector: unescape('setUp'),
|
691
|
+
fn: function (){
|
692
|
+
var self=this;
|
693
|
+
smalltalk.send(self, "_setUp", [], smalltalk.PackageTest);
|
694
|
+
(function($rec){smalltalk.send($rec, "_defaultCommitPathJs_", [unescape("javascripts/")]);return smalltalk.send($rec, "_defaultCommitPathSt_", [unescape("smalltalk/")]);})((smalltalk.Package || Package));
|
695
|
+
return self;}
|
696
|
+
}),
|
697
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
698
|
+
|
699
|
+
smalltalk.addMethod(
|
700
|
+
unescape('_testGrulCommitPathJsShouldBeServerGrulJs'),
|
701
|
+
smalltalk.method({
|
702
|
+
selector: unescape('testGrulCommitPathJsShouldBeServerGrulJs'),
|
703
|
+
fn: function (){
|
704
|
+
var self=this;
|
705
|
+
smalltalk.send(self, "_assert_equals_", [unescape("server/grul/js"), smalltalk.send(self['@grulPackage'], "_commitPathJs", [])]);
|
706
|
+
return self;}
|
707
|
+
}),
|
708
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
709
|
+
|
710
|
+
smalltalk.addMethod(
|
711
|
+
unescape('_testGrulCommitPathStShouldBeGrulSt'),
|
712
|
+
smalltalk.method({
|
713
|
+
selector: unescape('testGrulCommitPathStShouldBeGrulSt'),
|
714
|
+
fn: function (){
|
715
|
+
var self=this;
|
716
|
+
smalltalk.send(self, "_assert_equals_", [unescape("grul/st"), smalltalk.send(self['@grulPackage'], "_commitPathSt", [])]);
|
717
|
+
return self;}
|
718
|
+
}),
|
719
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
720
|
+
|
721
|
+
smalltalk.addMethod(
|
722
|
+
unescape('_testZorkCommitPathJsShouldBeJavascript'),
|
723
|
+
smalltalk.method({
|
724
|
+
selector: unescape('testZorkCommitPathJsShouldBeJavascript'),
|
725
|
+
fn: function (){
|
726
|
+
var self=this;
|
727
|
+
smalltalk.send(self, "_assert_equals_", [unescape("javascripts/"), smalltalk.send(self['@zorkPackage'], "_commitPathJs", [])]);
|
728
|
+
return self;}
|
729
|
+
}),
|
730
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
731
|
+
|
732
|
+
smalltalk.addMethod(
|
733
|
+
unescape('_testZorkCommitPathStShouldBeSmalltalk'),
|
734
|
+
smalltalk.method({
|
735
|
+
selector: unescape('testZorkCommitPathStShouldBeSmalltalk'),
|
736
|
+
fn: function (){
|
737
|
+
var self=this;
|
738
|
+
smalltalk.send(self, "_assert_equals_", [unescape("smalltalk/"), smalltalk.send(self['@zorkPackage'], "_commitPathSt", [])]);
|
739
|
+
return self;}
|
740
|
+
}),
|
741
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
742
|
+
|
743
|
+
|
744
|
+
smalltalk.addMethod(
|
745
|
+
unescape('_shouldInheritSelectors'),
|
746
|
+
smalltalk.method({
|
747
|
+
selector: unescape('shouldInheritSelectors'),
|
748
|
+
fn: function (){
|
749
|
+
var self=this;
|
750
|
+
return false;
|
751
|
+
return self;}
|
752
|
+
}),
|
753
|
+
smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
|
754
|
+
|
755
|
+
|
756
|
+
smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
757
|
+
smalltalk.addMethod(
|
758
|
+
unescape('_testValue'),
|
759
|
+
smalltalk.method({
|
760
|
+
selector: unescape('testValue'),
|
761
|
+
fn: function (){
|
762
|
+
var self=this;
|
763
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1) + (1);}), "_value", []), (2)]);
|
764
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x){return ((($receiver = x).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));}), "_value_", [(2)]), (3)]);
|
765
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(x, y){return ((($receiver = x).klass === smalltalk.Number) ? $receiver *y : smalltalk.send($receiver, "__star", [y]));}), "_value_value_", [(2), (4)]), (8)]);
|
766
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b, c){return (1);}), "_value", []), (1)]);
|
767
|
+
return self;}
|
768
|
+
}),
|
769
|
+
smalltalk.BlockClosureTest);
|
770
|
+
|
771
|
+
smalltalk.addMethod(
|
772
|
+
unescape('_testOnDo'),
|
773
|
+
smalltalk.method({
|
774
|
+
selector: unescape('testOnDo'),
|
775
|
+
fn: function (){
|
776
|
+
var self=this;
|
777
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send(smalltalk.send((smalltalk.Error || Error), "_new", []), "_signal", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return true;})])]);
|
778
|
+
return self;}
|
779
|
+
}),
|
780
|
+
smalltalk.BlockClosureTest);
|
781
|
+
|
782
|
+
smalltalk.addMethod(
|
783
|
+
unescape('_testEnsure'),
|
784
|
+
smalltalk.method({
|
785
|
+
selector: unescape('testEnsure'),
|
786
|
+
fn: function (){
|
787
|
+
var self=this;
|
788
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((function(){return smalltalk.send((smalltalk.Error || Error), "_new", []);}), "_ensure_", [(function(){return true;})])]);
|
789
|
+
return self;}
|
790
|
+
}),
|
791
|
+
smalltalk.BlockClosureTest);
|
792
|
+
|
793
|
+
smalltalk.addMethod(
|
794
|
+
unescape('_testNumArgs'),
|
795
|
+
smalltalk.method({
|
796
|
+
selector: unescape('testNumArgs'),
|
797
|
+
fn: function (){
|
798
|
+
var self=this;
|
799
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return nil;}), "_numArgs", []), (0)]);
|
800
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return nil;}), "_numArgs", []), (2)]);
|
801
|
+
return self;}
|
802
|
+
}),
|
803
|
+
smalltalk.BlockClosureTest);
|
804
|
+
|
805
|
+
smalltalk.addMethod(
|
806
|
+
unescape('_testValueWithPossibleArguments'),
|
807
|
+
smalltalk.method({
|
808
|
+
selector: unescape('testValueWithPossibleArguments'),
|
809
|
+
fn: function (){
|
810
|
+
var self=this;
|
811
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(){return (1);}), "_valueWithPossibleArguments_", [[(3), (4)]]), (1)]);
|
812
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(4) : smalltalk.send($receiver, "__plus", [(4)]));}), "_valueWithPossibleArguments_", [[(3), (4)]]), (7)]);
|
813
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +b : smalltalk.send($receiver, "__plus", [b]));}), "_valueWithPossibleArguments_", [[(3), (4), (5)]]), (7)]);
|
814
|
+
return self;}
|
815
|
+
}),
|
816
|
+
smalltalk.BlockClosureTest);
|
817
|
+
|
818
|
+
smalltalk.addMethod(
|
819
|
+
unescape('_testWhileTrue'),
|
820
|
+
smalltalk.method({
|
821
|
+
selector: unescape('testWhileTrue'),
|
822
|
+
fn: function (){
|
823
|
+
var self=this;
|
824
|
+
var i=nil;
|
825
|
+
(i=(0));
|
826
|
+
(function(){while((function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
|
827
|
+
smalltalk.send(self, "_assert_equals_", [i, (5)]);
|
828
|
+
(i=(0));
|
829
|
+
(function(){while((function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver <(5) : smalltalk.send($receiver, "__lt", [(5)]));})()) {}})();
|
830
|
+
smalltalk.send(self, "_assert_equals_", [i, (5)]);
|
831
|
+
return self;}
|
832
|
+
}),
|
833
|
+
smalltalk.BlockClosureTest);
|
834
|
+
|
835
|
+
smalltalk.addMethod(
|
836
|
+
unescape('_testWhileFalse'),
|
837
|
+
smalltalk.method({
|
838
|
+
selector: unescape('testWhileFalse'),
|
839
|
+
fn: function (){
|
840
|
+
var self=this;
|
841
|
+
var i=nil;
|
842
|
+
(i=(0));
|
843
|
+
(function(){while(!(function(){return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {(function(){return (i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));})()}})();
|
844
|
+
smalltalk.send(self, "_assert_equals_", [i, (6)]);
|
845
|
+
(i=(0));
|
846
|
+
(function(){while(!(function(){(i=((($receiver = i).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));return ((($receiver = i).klass === smalltalk.Number) ? $receiver >(5) : smalltalk.send($receiver, "__gt", [(5)]));})()) {}})();
|
847
|
+
smalltalk.send(self, "_assert_equals_", [i, (6)]);
|
848
|
+
return self;}
|
849
|
+
}),
|
850
|
+
smalltalk.BlockClosureTest);
|
851
|
+
|
852
|
+
smalltalk.addMethod(
|
853
|
+
unescape('_testCompiledSource'),
|
854
|
+
smalltalk.method({
|
855
|
+
selector: unescape('testCompiledSource'),
|
856
|
+
fn: function (){
|
857
|
+
var self=this;
|
858
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((function(){return (1) + (1);}), "_compiledSource", []), "_includesSubString_", ["function"])]);
|
859
|
+
return self;}
|
860
|
+
}),
|
861
|
+
smalltalk.BlockClosureTest);
|
862
|
+
|
863
|
+
|
864
|
+
|
865
|
+
smalltalk.addClass('ObjectTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
866
|
+
smalltalk.addMethod(
|
867
|
+
unescape('_testEquality'),
|
868
|
+
smalltalk.method({
|
869
|
+
selector: unescape('testEquality'),
|
870
|
+
fn: function (){
|
871
|
+
var self=this;
|
872
|
+
var o=nil;
|
873
|
+
(o=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
874
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
|
875
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [o])]);
|
876
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq", [o])]);
|
877
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq", [smalltalk.send(o, "_yourself", [])])]);
|
878
|
+
return self;}
|
879
|
+
}),
|
880
|
+
smalltalk.ObjectTest);
|
881
|
+
|
882
|
+
smalltalk.addMethod(
|
883
|
+
unescape('_testIdentity'),
|
884
|
+
smalltalk.method({
|
885
|
+
selector: unescape('testIdentity'),
|
886
|
+
fn: function (){
|
887
|
+
var self=this;
|
888
|
+
var o=nil;
|
889
|
+
(o=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
890
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
|
891
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
|
892
|
+
return self;}
|
893
|
+
}),
|
894
|
+
smalltalk.ObjectTest);
|
895
|
+
|
896
|
+
smalltalk.addMethod(
|
897
|
+
unescape('_testHalt'),
|
898
|
+
smalltalk.method({
|
899
|
+
selector: unescape('testHalt'),
|
900
|
+
fn: function (){
|
901
|
+
var self=this;
|
902
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
|
903
|
+
return self;}
|
904
|
+
}),
|
905
|
+
smalltalk.ObjectTest);
|
906
|
+
|
907
|
+
smalltalk.addMethod(
|
908
|
+
unescape('_testBasicAccess'),
|
909
|
+
smalltalk.method({
|
910
|
+
selector: unescape('testBasicAccess'),
|
911
|
+
fn: function (){
|
912
|
+
var self=this;
|
913
|
+
var o=nil;
|
914
|
+
(o=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
915
|
+
smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
|
916
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
|
917
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
|
918
|
+
return self;}
|
919
|
+
}),
|
920
|
+
smalltalk.ObjectTest);
|
921
|
+
|
922
|
+
smalltalk.addMethod(
|
923
|
+
unescape('_testNilUndefined'),
|
924
|
+
smalltalk.method({
|
925
|
+
selector: unescape('testNilUndefined'),
|
926
|
+
fn: function (){
|
927
|
+
var self=this;
|
928
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
|
929
|
+
return self;}
|
930
|
+
}),
|
931
|
+
smalltalk.ObjectTest);
|
932
|
+
|
933
|
+
smalltalk.addMethod(
|
934
|
+
unescape('_testidentityHash'),
|
935
|
+
smalltalk.method({
|
936
|
+
selector: unescape('testidentityHash'),
|
937
|
+
fn: function (){
|
938
|
+
var self=this;
|
939
|
+
var o1=nil;
|
940
|
+
var o2=nil;
|
941
|
+
(o1=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
942
|
+
(o2=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
943
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
|
944
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
|
945
|
+
return self;}
|
946
|
+
}),
|
947
|
+
smalltalk.ObjectTest);
|
948
|
+
|
949
|
+
smalltalk.addMethod(
|
950
|
+
unescape('_testBasicPerform'),
|
951
|
+
smalltalk.method({
|
952
|
+
selector: unescape('testBasicPerform'),
|
953
|
+
fn: function (){
|
954
|
+
var self=this;
|
955
|
+
var o=nil;
|
956
|
+
(o=smalltalk.send((smalltalk.Object || Object), "_new", []));
|
957
|
+
smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
|
958
|
+
smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
|
959
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
|
960
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
|
961
|
+
return self;}
|
962
|
+
}),
|
963
|
+
smalltalk.ObjectTest);
|
964
|
+
|
965
|
+
smalltalk.addMethod(
|
966
|
+
unescape('_testIfNil'),
|
967
|
+
smalltalk.method({
|
968
|
+
selector: unescape('testIfNil'),
|
969
|
+
fn: function (){
|
970
|
+
var self=this;
|
971
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
|
972
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
|
973
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
|
974
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
|
975
|
+
smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
|
976
|
+
return self;}
|
977
|
+
}),
|
978
|
+
smalltalk.ObjectTest);
|
979
|
+
|
980
|
+
smalltalk.addMethod(
|
981
|
+
unescape('_testInstVars'),
|
982
|
+
smalltalk.method({
|
983
|
+
selector: unescape('testInstVars'),
|
984
|
+
fn: function (){
|
985
|
+
var self=this;
|
986
|
+
var o=nil;
|
987
|
+
(o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
|
988
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
|
989
|
+
smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
|
990
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
|
991
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
|
992
|
+
return self;}
|
993
|
+
}),
|
994
|
+
smalltalk.ObjectTest);
|
995
|
+
|
996
|
+
smalltalk.addMethod(
|
997
|
+
unescape('_testYourself'),
|
998
|
+
smalltalk.method({
|
999
|
+
selector: unescape('testYourself'),
|
1000
|
+
fn: function (){
|
1001
|
+
var self=this;
|
1002
|
+
var o=nil;
|
1003
|
+
(o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []));
|
1004
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
|
1005
|
+
return self;}
|
1006
|
+
}),
|
1007
|
+
smalltalk.ObjectTest);
|
1008
|
+
|
1009
|
+
smalltalk.addMethod(
|
1010
|
+
unescape('_testDNU'),
|
1011
|
+
smalltalk.method({
|
1012
|
+
selector: unescape('testDNU'),
|
1013
|
+
fn: function (){
|
1014
|
+
var self=this;
|
1015
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
|
1016
|
+
return self;}
|
1017
|
+
}),
|
1018
|
+
smalltalk.ObjectTest);
|
1019
|
+
|
1020
|
+
|
1021
|
+
|
1022
|
+
smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1023
|
+
smalltalk.addMethod(
|
1024
|
+
unescape('_testEquality'),
|
1025
|
+
smalltalk.method({
|
1026
|
+
selector: unescape('testEquality'),
|
1027
|
+
fn: function (){
|
1028
|
+
var self=this;
|
1029
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
|
1030
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
|
1031
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
|
1032
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
|
1033
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
|
1034
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
|
1035
|
+
return self;}
|
1036
|
+
}),
|
1037
|
+
smalltalk.SymbolTest);
|
1038
|
+
|
1039
|
+
smalltalk.addMethod(
|
1040
|
+
unescape('_testAt'),
|
1041
|
+
smalltalk.method({
|
1042
|
+
selector: unescape('testAt'),
|
1043
|
+
fn: function (){
|
1044
|
+
var self=this;
|
1045
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
|
1046
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
|
1047
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
|
1048
|
+
return self;}
|
1049
|
+
}),
|
1050
|
+
smalltalk.SymbolTest);
|
1051
|
+
|
1052
|
+
smalltalk.addMethod(
|
1053
|
+
unescape('_testAtPut'),
|
1054
|
+
smalltalk.method({
|
1055
|
+
selector: unescape('testAtPut'),
|
1056
|
+
fn: function (){
|
1057
|
+
var self=this;
|
1058
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
|
1059
|
+
return self;}
|
1060
|
+
}),
|
1061
|
+
smalltalk.SymbolTest);
|
1062
|
+
|
1063
|
+
smalltalk.addMethod(
|
1064
|
+
unescape('_testIdentity'),
|
1065
|
+
smalltalk.method({
|
1066
|
+
selector: unescape('testIdentity'),
|
1067
|
+
fn: function (){
|
1068
|
+
var self=this;
|
1069
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
|
1070
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
|
1071
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
|
1072
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
|
1073
|
+
return self;}
|
1074
|
+
}),
|
1075
|
+
smalltalk.SymbolTest);
|
1076
|
+
|
1077
|
+
smalltalk.addMethod(
|
1078
|
+
unescape('_testComparing'),
|
1079
|
+
smalltalk.method({
|
1080
|
+
selector: unescape('testComparing'),
|
1081
|
+
fn: function (){
|
1082
|
+
var self=this;
|
1083
|
+
smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
|
1084
|
+
smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
|
1085
|
+
smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
|
1086
|
+
smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
|
1087
|
+
smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
|
1088
|
+
smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
|
1089
|
+
smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
|
1090
|
+
smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
|
1091
|
+
return self;}
|
1092
|
+
}),
|
1093
|
+
smalltalk.SymbolTest);
|
1094
|
+
|
1095
|
+
smalltalk.addMethod(
|
1096
|
+
unescape('_testSize'),
|
1097
|
+
smalltalk.method({
|
1098
|
+
selector: unescape('testSize'),
|
1099
|
+
fn: function (){
|
1100
|
+
var self=this;
|
1101
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
|
1102
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
|
1103
|
+
return self;}
|
1104
|
+
}),
|
1105
|
+
smalltalk.SymbolTest);
|
1106
|
+
|
1107
|
+
smalltalk.addMethod(
|
1108
|
+
unescape('_testAsString'),
|
1109
|
+
smalltalk.method({
|
1110
|
+
selector: unescape('testAsString'),
|
1111
|
+
fn: function (){
|
1112
|
+
var self=this;
|
1113
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
|
1114
|
+
return self;}
|
1115
|
+
}),
|
1116
|
+
smalltalk.SymbolTest);
|
1117
|
+
|
1118
|
+
smalltalk.addMethod(
|
1119
|
+
unescape('_testAsSymbol'),
|
1120
|
+
smalltalk.method({
|
1121
|
+
selector: unescape('testAsSymbol'),
|
1122
|
+
fn: function (){
|
1123
|
+
var self=this;
|
1124
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
|
1125
|
+
return self;}
|
1126
|
+
}),
|
1127
|
+
smalltalk.SymbolTest);
|
1128
|
+
|
1129
|
+
smalltalk.addMethod(
|
1130
|
+
unescape('_testCopying'),
|
1131
|
+
smalltalk.method({
|
1132
|
+
selector: unescape('testCopying'),
|
1133
|
+
fn: function (){
|
1134
|
+
var self=this;
|
1135
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
|
1136
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
|
1137
|
+
return self;}
|
1138
|
+
}),
|
1139
|
+
smalltalk.SymbolTest);
|
1140
|
+
|
1141
|
+
smalltalk.addMethod(
|
1142
|
+
unescape('_testIsSymbolIsString'),
|
1143
|
+
smalltalk.method({
|
1144
|
+
selector: unescape('testIsSymbolIsString'),
|
1145
|
+
fn: function (){
|
1146
|
+
var self=this;
|
1147
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
|
1148
|
+
smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
|
1149
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
|
1150
|
+
smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
|
1151
|
+
return self;}
|
1152
|
+
}),
|
1153
|
+
smalltalk.SymbolTest);
|
1154
|
+
|
1155
|
+
|
1156
|
+
|
1157
|
+
smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
|
1158
|
+
smalltalk.addMethod(
|
1159
|
+
unescape('_foo'),
|
1160
|
+
smalltalk.method({
|
1161
|
+
selector: unescape('foo'),
|
1162
|
+
fn: function (){
|
1163
|
+
var self=this;
|
1164
|
+
return self['@foo'];
|
1165
|
+
return self;}
|
1166
|
+
}),
|
1167
|
+
smalltalk.ObjectMock);
|
1168
|
+
|
1169
|
+
smalltalk.addMethod(
|
1170
|
+
unescape('_foo_'),
|
1171
|
+
smalltalk.method({
|
1172
|
+
selector: unescape('foo%3A'),
|
1173
|
+
fn: function (anObject){
|
1174
|
+
var self=this;
|
1175
|
+
(self['@foo']=anObject);
|
1176
|
+
return self;}
|
1177
|
+
}),
|
1178
|
+
smalltalk.ObjectMock);
|
1179
|
+
|
1180
|
+
|
1181
|
+
|
1182
|
+
smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1183
|
+
smalltalk.addMethod(
|
1184
|
+
unescape('_testIsNil'),
|
1185
|
+
smalltalk.method({
|
1186
|
+
selector: unescape('testIsNil'),
|
1187
|
+
fn: function (){
|
1188
|
+
var self=this;
|
1189
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
|
1190
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
|
1191
|
+
return self;}
|
1192
|
+
}),
|
1193
|
+
smalltalk.UndefinedTest);
|
1194
|
+
|
1195
|
+
smalltalk.addMethod(
|
1196
|
+
unescape('_testIfNil'),
|
1197
|
+
smalltalk.method({
|
1198
|
+
selector: unescape('testIfNil'),
|
1199
|
+
fn: function (){
|
1200
|
+
var self=this;
|
1201
|
+
smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
|
1202
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
|
1203
|
+
smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
|
1204
|
+
smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
|
1205
|
+
return self;}
|
1206
|
+
}),
|
1207
|
+
smalltalk.UndefinedTest);
|
1208
|
+
|
1209
|
+
smalltalk.addMethod(
|
1210
|
+
unescape('_testCopying'),
|
1211
|
+
smalltalk.method({
|
1212
|
+
selector: unescape('testCopying'),
|
1213
|
+
fn: function (){
|
1214
|
+
var self=this;
|
1215
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
|
1216
|
+
return self;}
|
1217
|
+
}),
|
1218
|
+
smalltalk.UndefinedTest);
|
1219
|
+
|
1220
|
+
smalltalk.addMethod(
|
1221
|
+
unescape('_testDeepCopy'),
|
1222
|
+
smalltalk.method({
|
1223
|
+
selector: unescape('testDeepCopy'),
|
1224
|
+
fn: function (){
|
1225
|
+
var self=this;
|
1226
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
|
1227
|
+
return self;}
|
1228
|
+
}),
|
1229
|
+
smalltalk.UndefinedTest);
|
1230
|
+
|
1231
|
+
|
1232
|
+
|
1233
|
+
smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1234
|
+
smalltalk.addMethod(
|
1235
|
+
unescape('_testAccessing'),
|
1236
|
+
smalltalk.method({
|
1237
|
+
selector: unescape('testAccessing'),
|
1238
|
+
fn: function (){
|
1239
|
+
var self=this;
|
1240
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
|
1241
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
|
1242
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
|
1243
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
|
1244
|
+
return self;}
|
1245
|
+
}),
|
1246
|
+
smalltalk.PointTest);
|
1247
|
+
|
1248
|
+
smalltalk.addMethod(
|
1249
|
+
unescape('_testAt'),
|
1250
|
+
smalltalk.method({
|
1251
|
+
selector: unescape('testAt'),
|
1252
|
+
fn: function (){
|
1253
|
+
var self=this;
|
1254
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
|
1255
|
+
return self;}
|
1256
|
+
}),
|
1257
|
+
smalltalk.PointTest);
|
1258
|
+
|
1259
|
+
smalltalk.addMethod(
|
1260
|
+
unescape('_testEgality'),
|
1261
|
+
smalltalk.method({
|
1262
|
+
selector: unescape('testEgality'),
|
1263
|
+
fn: function (){
|
1264
|
+
var self=this;
|
1265
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
|
1266
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
|
1267
|
+
return self;}
|
1268
|
+
}),
|
1269
|
+
smalltalk.PointTest);
|
1270
|
+
|
1271
|
+
smalltalk.addMethod(
|
1272
|
+
unescape('_testArithmetic'),
|
1273
|
+
smalltalk.method({
|
1274
|
+
selector: unescape('testArithmetic'),
|
1275
|
+
fn: function (){
|
1276
|
+
var self=this;
|
1277
|
+
smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__star", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(9), (16)])]);
|
1278
|
+
smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver +smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(6), (8)])]);
|
1279
|
+
smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver -smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__minus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(0), (0)])]);
|
1280
|
+
smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((6), "__at", [(8)])).klass === smalltalk.Number) ? $receiver /smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__slash", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(2), (2)])]);
|
1281
|
+
return self;}
|
1282
|
+
}),
|
1283
|
+
smalltalk.PointTest);
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1288
|
+
smalltalk.addMethod(
|
1289
|
+
unescape('_textNext'),
|
1290
|
+
smalltalk.method({
|
1291
|
+
selector: unescape('textNext'),
|
1292
|
+
fn: function (){
|
1293
|
+
var self=this;
|
1294
|
+
smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
|
1295
|
+
var next=nil;
|
1296
|
+
(next=smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", []));smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver >=(0) : smalltalk.send($receiver, "__gt_eq", [(0)]))]);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver <(1) : smalltalk.send($receiver, "__lt", [(1)]))]);smalltalk.send(self, "_deny_", [smalltalk.send(current, "__eq", [next])]);return smalltalk.send(next, "__eq", [current]);})]);
|
1297
|
+
return self;}
|
1298
|
+
}),
|
1299
|
+
smalltalk.RandomTest);
|
1300
|
+
|
1301
|
+
|
1302
|
+
|
1303
|
+
smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
|
1304
|
+
smalltalk.addMethod(
|
1305
|
+
unescape('_setUp'),
|
1306
|
+
smalltalk.method({
|
1307
|
+
selector: unescape('setUp'),
|
1308
|
+
fn: function (){
|
1309
|
+
var self=this;
|
1310
|
+
(self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []));
|
1311
|
+
return self;}
|
1312
|
+
}),
|
1313
|
+
smalltalk.ClassBuilderTest);
|
1314
|
+
|
1315
|
+
smalltalk.addMethod(
|
1316
|
+
unescape('_tearDown'),
|
1317
|
+
smalltalk.method({
|
1318
|
+
selector: unescape('tearDown'),
|
1319
|
+
fn: function (){
|
1320
|
+
var self=this;
|
1321
|
+
(($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return (self['@theClass']=nil);})() : nil;
|
1322
|
+
return self;}
|
1323
|
+
}),
|
1324
|
+
smalltalk.ClassBuilderTest);
|
1325
|
+
|
1326
|
+
smalltalk.addMethod(
|
1327
|
+
unescape('_testClassCopy'),
|
1328
|
+
smalltalk.method({
|
1329
|
+
selector: unescape('testClassCopy'),
|
1330
|
+
fn: function (){
|
1331
|
+
var self=this;
|
1332
|
+
(self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]));
|
1333
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
|
1334
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
|
1335
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
|
1336
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
|
1337
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
|
1338
|
+
return self;}
|
1339
|
+
}),
|
1340
|
+
smalltalk.ClassBuilderTest);
|
1341
|
+
|
1342
|
+
smalltalk.addMethod(
|
1343
|
+
unescape('_testInstanceVariableNames'),
|
1344
|
+
smalltalk.method({
|
1345
|
+
selector: unescape('testInstanceVariableNames'),
|
1346
|
+
fn: function (){
|
1347
|
+
var self=this;
|
1348
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", [" hello world "]), ["hello", "world"]]);
|
1349
|
+
return self;}
|
1350
|
+
}),
|
1351
|
+
smalltalk.ClassBuilderTest);
|
1352
|
+
|
1353
|
+
|
1354
|
+
|
1355
|
+
smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
1356
|
+
smalltalk.addMethod(
|
1357
|
+
unescape('_testUnicity'),
|
1358
|
+
smalltalk.method({
|
1359
|
+
selector: unescape('testUnicity'),
|
1360
|
+
fn: function (){
|
1361
|
+
var self=this;
|
1362
|
+
var set=nil;
|
1363
|
+
(set=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
1364
|
+
smalltalk.send(set, "_add_", [(21)]);
|
1365
|
+
smalltalk.send(set, "_add_", ["hello"]);
|
1366
|
+
smalltalk.send(set, "_add_", [(21)]);
|
1367
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
|
1368
|
+
smalltalk.send(set, "_add_", ["hello"]);
|
1369
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
|
1370
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
|
1371
|
+
return self;}
|
1372
|
+
}),
|
1373
|
+
smalltalk.SetTest);
|
1374
|
+
|
1375
|
+
smalltalk.addMethod(
|
1376
|
+
unescape('_testAt'),
|
1377
|
+
smalltalk.method({
|
1378
|
+
selector: unescape('testAt'),
|
1379
|
+
fn: function (){
|
1380
|
+
var self=this;
|
1381
|
+
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
|
1382
|
+
return self;}
|
1383
|
+
}),
|
1384
|
+
smalltalk.SetTest);
|
1385
|
+
|
1386
|
+
smalltalk.addMethod(
|
1387
|
+
unescape('_testAddRemove'),
|
1388
|
+
smalltalk.method({
|
1389
|
+
selector: unescape('testAddRemove'),
|
1390
|
+
fn: function (){
|
1391
|
+
var self=this;
|
1392
|
+
var set=nil;
|
1393
|
+
(set=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
1394
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
|
1395
|
+
smalltalk.send(set, "_add_", [(3)]);
|
1396
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
|
1397
|
+
smalltalk.send(set, "_add_", [(5)]);
|
1398
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
|
1399
|
+
smalltalk.send(set, "_remove_", [(3)]);
|
1400
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
|
1401
|
+
return self;}
|
1402
|
+
}),
|
1403
|
+
smalltalk.SetTest);
|
1404
|
+
|
1405
|
+
smalltalk.addMethod(
|
1406
|
+
unescape('_testSize'),
|
1407
|
+
smalltalk.method({
|
1408
|
+
selector: unescape('testSize'),
|
1409
|
+
fn: function (){
|
1410
|
+
var self=this;
|
1411
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
|
1412
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
|
1413
|
+
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
|
1414
|
+
return self;}
|
1415
|
+
}),
|
1416
|
+
smalltalk.SetTest);
|
1417
|
+
|
1418
|
+
|
1419
|
+
|