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