resin 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/amber/css/amber-normalize.css +73 -73
- data/amber/css/amber-normalize.less +1 -1
- data/amber/css/amber.css +106 -106
- data/amber/css/helios.css +242 -0
- data/amber/images/hsplitter.png +0 -0
- data/amber/images/vsplitter.png +0 -0
- data/amber/js/Benchfib.deploy.js +116 -38
- data/amber/js/Benchfib.js +120 -42
- data/amber/js/Canvas.deploy.js +674 -403
- data/amber/js/Canvas.js +682 -411
- data/amber/js/Compiler-AST.deploy.js +1150 -0
- data/amber/js/Compiler-AST.js +1591 -0
- data/amber/js/Compiler-Core.deploy.js +1562 -0
- data/amber/js/Compiler-Core.js +1972 -0
- data/amber/js/Compiler-Exceptions.deploy.js +114 -0
- data/amber/js/Compiler-Exceptions.js +161 -0
- data/amber/js/Compiler-IR.deploy.js +2326 -0
- data/amber/js/Compiler-IR.js +3146 -0
- data/amber/js/Compiler-Inlining.deploy.js +1147 -0
- data/amber/js/Compiler-Inlining.js +1514 -0
- data/amber/js/Compiler-Semantic.deploy.js +1207 -0
- data/amber/js/Compiler-Semantic.js +1628 -0
- data/amber/js/Compiler-Tests.deploy.js +646 -60
- data/amber/js/Compiler-Tests.js +843 -82
- data/amber/js/Compiler.deploy.js +1097 -159
- data/amber/js/Compiler.js +1414 -161
- data/amber/js/Examples.deploy.js +31 -15
- data/amber/js/Examples.js +33 -17
- data/amber/js/Helios-Announcements.deploy.js +127 -0
- data/amber/js/Helios-Announcements.js +157 -0
- data/amber/js/Helios-Browser.deploy.js +1473 -0
- data/amber/js/Helios-Browser.js +1953 -0
- data/amber/js/Helios-Commands.deploy.js +403 -0
- data/amber/js/Helios-Commands.js +563 -0
- data/amber/js/Helios-Core.deploy.js +1070 -0
- data/amber/js/Helios-Core.js +1445 -0
- data/amber/js/Helios-Environments.deploy.js +132 -0
- data/amber/js/Helios-Environments.js +179 -0
- data/amber/js/Helios-Inspector.deploy.js +855 -0
- data/amber/js/Helios-Inspector.js +1155 -0
- data/amber/js/Helios-KeyBindings.deploy.js +753 -0
- data/amber/js/Helios-KeyBindings.js +1023 -0
- data/amber/js/Helios-Layout.deploy.js +383 -0
- data/amber/js/Helios-Layout.js +523 -0
- data/amber/js/Helios-Workspace.deploy.js +799 -0
- data/amber/js/Helios-Workspace.js +1074 -0
- data/amber/js/IDE.deploy.js +2541 -1490
- data/amber/js/IDE.js +2721 -1660
- data/amber/js/Importer-Exporter.deploy.js +671 -0
- data/amber/js/Importer-Exporter.js +816 -0
- data/amber/js/Kernel-Announcements.deploy.js +137 -20
- data/amber/js/Kernel-Announcements.js +176 -22
- data/amber/js/Kernel-Classes.deploy.js +555 -168
- data/amber/js/Kernel-Classes.js +662 -205
- data/amber/js/Kernel-Collections.deploy.js +1403 -618
- data/amber/js/Kernel-Collections.js +1545 -690
- data/amber/js/Kernel-Exceptions.deploy.js +109 -45
- data/amber/js/Kernel-Exceptions.js +123 -49
- data/amber/js/Kernel-Methods.deploy.js +196 -81
- data/amber/js/Kernel-Methods.js +214 -89
- data/amber/js/Kernel-Objects.deploy.js +1542 -1117
- data/amber/js/Kernel-Objects.js +1593 -1148
- data/amber/js/Kernel-Tests.deploy.js +1725 -772
- data/amber/js/Kernel-Tests.js +2301 -1123
- data/amber/js/Kernel-Transcript.deploy.js +23 -25
- data/amber/js/Kernel-Transcript.js +24 -26
- data/amber/js/SUnit.deploy.js +204 -131
- data/amber/js/SUnit.js +222 -139
- data/amber/js/Spaces.deploy.js +240 -0
- data/amber/js/Spaces.js +326 -0
- data/amber/js/amber.js +26 -7
- data/amber/js/boot.js +65 -47
- data/amber/js/init.js +1 -1
- data/amber/js/lib/CodeMirror/amber.css +21 -21
- data/amber/js/lib/CodeMirror/codemirror.css +119 -13
- data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
- data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
- data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
- data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
- data/amber/st/Compiler-AST.st +505 -0
- data/amber/st/Compiler-Core.st +835 -0
- data/amber/st/Compiler-Exceptions.st +87 -0
- data/amber/st/Compiler-IR.st +1097 -0
- data/amber/st/Compiler-Inlining.st +650 -0
- data/amber/st/Compiler-Semantic.st +558 -0
- data/amber/st/Compiler-Tests.st +285 -381
- data/amber/st/Compiler.st +725 -2
- data/amber/st/Helios-Announcements.st +104 -0
- data/amber/st/Helios-Browser.st +708 -0
- data/amber/st/Helios-Commands.st +223 -0
- data/amber/st/Helios-Core.st +532 -0
- data/amber/st/Helios-Environments.st +98 -0
- data/amber/st/Helios-Inspector.st +367 -0
- data/amber/st/Helios-KeyBindings.st +337 -0
- data/amber/st/Helios-Layout.st +199 -0
- data/amber/st/Helios-Workspace.st +367 -0
- data/amber/st/IDE.st +75 -53
- data/amber/st/Importer-Exporter.st +386 -0
- data/amber/st/Kernel-Announcements.st +92 -0
- data/amber/st/Kernel-Classes.st +137 -15
- data/amber/st/Kernel-Collections.st +137 -47
- data/amber/st/Kernel-Exceptions.st +14 -0
- data/amber/st/Kernel-Methods.st +9 -1
- data/amber/st/Kernel-Objects.st +29 -5
- data/amber/st/Kernel-Tests.st +545 -199
- data/amber/st/SUnit.st +10 -0
- data/amber/st/Spaces.st +142 -0
- data/lib/resin/app.rb +1 -1
- metadata +86 -31
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
|
@@ -1,47 +1,4 @@
|
|
|
1
1
|
smalltalk.addPackage('Kernel-Tests', {});
|
|
2
|
-
smalltalk.addClass('ArrayTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
3
|
-
smalltalk.addMethod(
|
|
4
|
-
"_testAtIfAbsent",
|
|
5
|
-
smalltalk.method({
|
|
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",
|
|
25
|
-
fn: function (){
|
|
26
|
-
var self=this;
|
|
27
|
-
smalltalk.send(self, "_assert_equals_", [[(1),(2),(3)], smalltalk.send([(1),(2),(3),(4),(5)], "_first_", [(3)])]);
|
|
28
|
-
return self;}
|
|
29
|
-
}),
|
|
30
|
-
smalltalk.ArrayTest);
|
|
31
|
-
|
|
32
|
-
smalltalk.addMethod(
|
|
33
|
-
"_testIfEmpty",
|
|
34
|
-
smalltalk.method({
|
|
35
|
-
selector: "testIfEmpty",
|
|
36
|
-
fn: function (){
|
|
37
|
-
var self=this;
|
|
38
|
-
smalltalk.send(self, "_assert_equals_", ["zork", smalltalk.send("", "_ifEmpty_", [(function(){return "zork";})])]);
|
|
39
|
-
return self;}
|
|
40
|
-
}),
|
|
41
|
-
smalltalk.ArrayTest);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
2
|
smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
46
3
|
smalltalk.addMethod(
|
|
47
4
|
"_testCompiledSource",
|
|
@@ -49,8 +6,10 @@ smalltalk.method({
|
|
|
49
6
|
selector: "testCompiledSource",
|
|
50
7
|
fn: function (){
|
|
51
8
|
var self=this;
|
|
52
|
-
smalltalk.send(self,
|
|
53
|
-
return
|
|
9
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((function(){
|
|
10
|
+
return smalltalk.send((1),"__plus",[(1)]);
|
|
11
|
+
}),"_compiledSource",[]),"_includesSubString_",["function"])]);
|
|
12
|
+
return self}
|
|
54
13
|
}),
|
|
55
14
|
smalltalk.BlockClosureTest);
|
|
56
15
|
|
|
@@ -60,8 +19,12 @@ smalltalk.method({
|
|
|
60
19
|
selector: "testEnsure",
|
|
61
20
|
fn: function (){
|
|
62
21
|
var self=this;
|
|
63
|
-
smalltalk.send(self,
|
|
64
|
-
return
|
|
22
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((function(){
|
|
23
|
+
return smalltalk.send((smalltalk.Error || Error),"_new",[]);
|
|
24
|
+
}),"_ensure_",[(function(){
|
|
25
|
+
return true;
|
|
26
|
+
})])]);
|
|
27
|
+
return self}
|
|
65
28
|
}),
|
|
66
29
|
smalltalk.BlockClosureTest);
|
|
67
30
|
|
|
@@ -71,9 +34,11 @@ smalltalk.method({
|
|
|
71
34
|
selector: "testNumArgs",
|
|
72
35
|
fn: function (){
|
|
73
36
|
var self=this;
|
|
74
|
-
smalltalk.send(self,
|
|
75
|
-
|
|
76
|
-
|
|
37
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
|
|
38
|
+
}),"_numArgs",[]),(0)]);
|
|
39
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b){
|
|
40
|
+
}),"_numArgs",[]),(2)]);
|
|
41
|
+
return self}
|
|
77
42
|
}),
|
|
78
43
|
smalltalk.BlockClosureTest);
|
|
79
44
|
|
|
@@ -83,8 +48,12 @@ smalltalk.method({
|
|
|
83
48
|
selector: "testOnDo",
|
|
84
49
|
fn: function (){
|
|
85
50
|
var self=this;
|
|
86
|
-
smalltalk.send(self,
|
|
87
|
-
return
|
|
51
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((function(){
|
|
52
|
+
return smalltalk.send(smalltalk.send((smalltalk.Error || Error),"_new",[]),"_signal",[]);
|
|
53
|
+
}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
|
|
54
|
+
return true;
|
|
55
|
+
})])]);
|
|
56
|
+
return self}
|
|
88
57
|
}),
|
|
89
58
|
smalltalk.BlockClosureTest);
|
|
90
59
|
|
|
@@ -94,11 +63,19 @@ smalltalk.method({
|
|
|
94
63
|
selector: "testValue",
|
|
95
64
|
fn: function (){
|
|
96
65
|
var self=this;
|
|
97
|
-
smalltalk.send(self,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
smalltalk.send(self,
|
|
101
|
-
return
|
|
66
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
|
|
67
|
+
return smalltalk.send((1),"__plus",[(1)]);
|
|
68
|
+
}),"_value",[]),(2)]);
|
|
69
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(x){
|
|
70
|
+
return smalltalk.send(x,"__plus",[(1)]);
|
|
71
|
+
}),"_value_",[(2)]),(3)]);
|
|
72
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(x,y){
|
|
73
|
+
return smalltalk.send(x,"__star",[y]);
|
|
74
|
+
}),"_value_value_",[(2),(4)]),(8)]);
|
|
75
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b,c){
|
|
76
|
+
return (1);
|
|
77
|
+
}),"_value",[]),(1)]);
|
|
78
|
+
return self}
|
|
102
79
|
}),
|
|
103
80
|
smalltalk.BlockClosureTest);
|
|
104
81
|
|
|
@@ -108,10 +85,16 @@ smalltalk.method({
|
|
|
108
85
|
selector: "testValueWithPossibleArguments",
|
|
109
86
|
fn: function (){
|
|
110
87
|
var self=this;
|
|
111
|
-
smalltalk.send(self,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
88
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(){
|
|
89
|
+
return (1);
|
|
90
|
+
}),"_valueWithPossibleArguments_",[[(3), (4)]]),(1)]);
|
|
91
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a){
|
|
92
|
+
return smalltalk.send(a,"__plus",[(4)]);
|
|
93
|
+
}),"_valueWithPossibleArguments_",[[(3), (4)]]),(7)]);
|
|
94
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((function(a,b){
|
|
95
|
+
return smalltalk.send(a,"__plus",[b]);
|
|
96
|
+
}),"_valueWithPossibleArguments_",[[(3), (4), (5)]]),(7)]);
|
|
97
|
+
return self}
|
|
115
98
|
}),
|
|
116
99
|
smalltalk.BlockClosureTest);
|
|
117
100
|
|
|
@@ -121,14 +104,23 @@ smalltalk.method({
|
|
|
121
104
|
selector: "testWhileFalse",
|
|
122
105
|
fn: function (){
|
|
123
106
|
var self=this;
|
|
124
|
-
var i
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
smalltalk.send(
|
|
128
|
-
(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
107
|
+
var i;
|
|
108
|
+
i=(0);
|
|
109
|
+
smalltalk.send((function(){
|
|
110
|
+
return smalltalk.send(i,"__gt",[(5)]);
|
|
111
|
+
}),"_whileFalse_",[(function(){
|
|
112
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
113
|
+
return i;
|
|
114
|
+
})]);
|
|
115
|
+
smalltalk.send(self,"_assert_equals_",[i,(6)]);
|
|
116
|
+
i=(0);
|
|
117
|
+
smalltalk.send((function(){
|
|
118
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
119
|
+
i;
|
|
120
|
+
return smalltalk.send(i,"__gt",[(5)]);
|
|
121
|
+
}),"_whileFalse",[]);
|
|
122
|
+
smalltalk.send(self,"_assert_equals_",[i,(6)]);
|
|
123
|
+
return self}
|
|
132
124
|
}),
|
|
133
125
|
smalltalk.BlockClosureTest);
|
|
134
126
|
|
|
@@ -138,14 +130,23 @@ smalltalk.method({
|
|
|
138
130
|
selector: "testWhileTrue",
|
|
139
131
|
fn: function (){
|
|
140
132
|
var self=this;
|
|
141
|
-
var i
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
smalltalk.send(
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
var i;
|
|
134
|
+
i=(0);
|
|
135
|
+
smalltalk.send((function(){
|
|
136
|
+
return smalltalk.send(i,"__lt",[(5)]);
|
|
137
|
+
}),"_whileTrue_",[(function(){
|
|
138
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
139
|
+
return i;
|
|
140
|
+
})]);
|
|
141
|
+
smalltalk.send(self,"_assert_equals_",[i,(5)]);
|
|
142
|
+
i=(0);
|
|
143
|
+
smalltalk.send((function(){
|
|
144
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
145
|
+
i;
|
|
146
|
+
return smalltalk.send(i,"__lt",[(5)]);
|
|
147
|
+
}),"_whileTrue",[]);
|
|
148
|
+
smalltalk.send(self,"_assert_equals_",[i,(5)]);
|
|
149
|
+
return self}
|
|
149
150
|
}),
|
|
150
151
|
smalltalk.BlockClosureTest);
|
|
151
152
|
|
|
@@ -158,17 +159,17 @@ smalltalk.method({
|
|
|
158
159
|
selector: "testEquality",
|
|
159
160
|
fn: function (){
|
|
160
161
|
var self=this;
|
|
161
|
-
smalltalk.send(self,
|
|
162
|
-
smalltalk.send(self,
|
|
163
|
-
smalltalk.send(self,
|
|
164
|
-
smalltalk.send(self,
|
|
165
|
-
smalltalk.send(self,
|
|
166
|
-
smalltalk.send(self,
|
|
167
|
-
smalltalk.send(self,
|
|
168
|
-
smalltalk.send(self,
|
|
169
|
-
smalltalk.send(self,
|
|
170
|
-
smalltalk.send(self,
|
|
171
|
-
return self
|
|
162
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[false])]);
|
|
163
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[(0)])]);
|
|
164
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[false])]);
|
|
165
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[""])]);
|
|
166
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"__eq",[true])]);
|
|
167
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[true])]);
|
|
168
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(true,"__eq",[false])]);
|
|
169
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"__eq",[false])]);
|
|
170
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq",[true])]);
|
|
171
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq",[smalltalk.send(true,"_yourself",[])])]);
|
|
172
|
+
return self}
|
|
172
173
|
}),
|
|
173
174
|
smalltalk.BooleanTest);
|
|
174
175
|
|
|
@@ -178,17 +179,17 @@ smalltalk.method({
|
|
|
178
179
|
selector: "testIdentity",
|
|
179
180
|
fn: function (){
|
|
180
181
|
var self=this;
|
|
181
|
-
smalltalk.send(self,
|
|
182
|
-
smalltalk.send(self,
|
|
183
|
-
smalltalk.send(self,
|
|
184
|
-
smalltalk.send(self,
|
|
185
|
-
smalltalk.send(self,
|
|
186
|
-
smalltalk.send(self,
|
|
187
|
-
smalltalk.send(self,
|
|
188
|
-
smalltalk.send(self,
|
|
189
|
-
smalltalk.send(self,
|
|
190
|
-
smalltalk.send(self,
|
|
191
|
-
return self
|
|
182
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq_eq",[false])]);
|
|
183
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[(0)])]);
|
|
184
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("","__eq_eq",[false])]);
|
|
185
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[""])]);
|
|
186
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"__eq_eq",[true])]);
|
|
187
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq_eq",[true])]);
|
|
188
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(true,"__eq_eq",[false])]);
|
|
189
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"__eq_eq",[false])]);
|
|
190
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq_eq",[true])]);
|
|
191
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(true,"_yourself",[]),"__eq_eq",[smalltalk.send(true,"_yourself",[])])]);
|
|
192
|
+
return self}
|
|
192
193
|
}),
|
|
193
194
|
smalltalk.BooleanTest);
|
|
194
195
|
|
|
@@ -198,15 +199,48 @@ smalltalk.method({
|
|
|
198
199
|
selector: "testIfTrueIfFalse",
|
|
199
200
|
fn: function (){
|
|
200
201
|
var self=this;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
smalltalk.send(self,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
202
|
+
var $1,$2,$3,$4,$5,$6,$7,$8;
|
|
203
|
+
if(smalltalk.assert(true)){
|
|
204
|
+
$1="alternative block";
|
|
205
|
+
};
|
|
206
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($1,"__eq",["alternative block"])]);
|
|
207
|
+
if(! smalltalk.assert(true)){
|
|
208
|
+
$2="alternative block";
|
|
209
|
+
};
|
|
210
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($2,"__eq",[nil])]);
|
|
211
|
+
if(smalltalk.assert(false)){
|
|
212
|
+
$3="alternative block";
|
|
213
|
+
};
|
|
214
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($3,"__eq",[nil])]);
|
|
215
|
+
if(! smalltalk.assert(false)){
|
|
216
|
+
$4="alternative block";
|
|
217
|
+
};
|
|
218
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($4,"__eq",["alternative block"])]);
|
|
219
|
+
if(smalltalk.assert(false)){
|
|
220
|
+
$5="alternative block";
|
|
221
|
+
} else {
|
|
222
|
+
$5="alternative block2";
|
|
223
|
+
};
|
|
224
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($5,"__eq",["alternative block2"])]);
|
|
225
|
+
if(smalltalk.assert(false)){
|
|
226
|
+
$6="alternative block2";
|
|
227
|
+
} else {
|
|
228
|
+
$6="alternative block";
|
|
229
|
+
};
|
|
230
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($6,"__eq",["alternative block"])]);
|
|
231
|
+
if(smalltalk.assert(true)){
|
|
232
|
+
$7="alternative block";
|
|
233
|
+
} else {
|
|
234
|
+
$7="alternative block2";
|
|
235
|
+
};
|
|
236
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($7,"__eq",["alternative block"])]);
|
|
237
|
+
if(smalltalk.assert(true)){
|
|
238
|
+
$8="alternative block2";
|
|
239
|
+
} else {
|
|
240
|
+
$8="alternative block";
|
|
241
|
+
};
|
|
242
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($8,"__eq",["alternative block2"])]);
|
|
243
|
+
return self}
|
|
210
244
|
}),
|
|
211
245
|
smalltalk.BooleanTest);
|
|
212
246
|
|
|
@@ -216,11 +250,22 @@ smalltalk.method({
|
|
|
216
250
|
selector: "testLogic",
|
|
217
251
|
fn: function (){
|
|
218
252
|
var self=this;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
253
|
+
var $1,$2,$3,$4;
|
|
254
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_&",[true])]);
|
|
255
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(true,"_&",[false])]);
|
|
256
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"_&",[true])]);
|
|
257
|
+
$1=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_&",[false])]);
|
|
258
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_|",[true])]);
|
|
259
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_|",[false])]);
|
|
260
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"_|",[true])]);
|
|
261
|
+
$2=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_|",[false])]);
|
|
262
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_&",[smalltalk.send((1),"__gt",[(0)])])]);
|
|
263
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_&",[false])]);
|
|
264
|
+
$3=smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_&",[smalltalk.send((1),"__gt",[(2)])])]);
|
|
265
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"_|",[smalltalk.send((1),"__gt",[(0)])])]);
|
|
266
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_|",[false])]);
|
|
267
|
+
$4=smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_|",[smalltalk.send((1),"__gt",[(2)])])]);
|
|
268
|
+
return self}
|
|
224
269
|
}),
|
|
225
270
|
smalltalk.BooleanTest);
|
|
226
271
|
|
|
@@ -230,11 +275,50 @@ smalltalk.method({
|
|
|
230
275
|
selector: "testLogicKeywords",
|
|
231
276
|
fn: function (){
|
|
232
277
|
var self=this;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
278
|
+
var $1,$2,$3,$4;
|
|
279
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_and_",[(function(){
|
|
280
|
+
return true;
|
|
281
|
+
})])]);
|
|
282
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(true,"_and_",[(function(){
|
|
283
|
+
return false;
|
|
284
|
+
})])]);
|
|
285
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"_and_",[(function(){
|
|
286
|
+
return true;
|
|
287
|
+
})])]);
|
|
288
|
+
$1=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_and_",[(function(){
|
|
289
|
+
return false;
|
|
290
|
+
})])]);
|
|
291
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_or_",[(function(){
|
|
292
|
+
return true;
|
|
293
|
+
})])]);
|
|
294
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_or_",[(function(){
|
|
295
|
+
return false;
|
|
296
|
+
})])]);
|
|
297
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"_or_",[(function(){
|
|
298
|
+
return true;
|
|
299
|
+
})])]);
|
|
300
|
+
$2=smalltalk.send(self,"_deny_",[smalltalk.send(false,"_or_",[(function(){
|
|
301
|
+
return false;
|
|
302
|
+
})])]);
|
|
303
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(true,"_and_",[(function(){
|
|
304
|
+
return smalltalk.send((1),"__gt",[(0)]);
|
|
305
|
+
})])]);
|
|
306
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_and_",[(function(){
|
|
307
|
+
return false;
|
|
308
|
+
})])]);
|
|
309
|
+
$3=smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_and_",[(function(){
|
|
310
|
+
return smalltalk.send((1),"__gt",[(2)]);
|
|
311
|
+
})])]);
|
|
312
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(false,"_or_",[(function(){
|
|
313
|
+
return smalltalk.send((1),"__gt",[(0)]);
|
|
314
|
+
})])]);
|
|
315
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_or_",[(function(){
|
|
316
|
+
return false;
|
|
317
|
+
})])]);
|
|
318
|
+
$4=smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__gt",[(0)]),"_or_",[(function(){
|
|
319
|
+
return smalltalk.send((1),"__gt",[(2)]);
|
|
320
|
+
})])]);
|
|
321
|
+
return self}
|
|
238
322
|
}),
|
|
239
323
|
smalltalk.BooleanTest);
|
|
240
324
|
|
|
@@ -247,8 +331,8 @@ smalltalk.method({
|
|
|
247
331
|
selector: "setUp",
|
|
248
332
|
fn: function (){
|
|
249
333
|
var self=this;
|
|
250
|
-
|
|
251
|
-
return self
|
|
334
|
+
self["@builder"]=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]);
|
|
335
|
+
return self}
|
|
252
336
|
}),
|
|
253
337
|
smalltalk.ClassBuilderTest);
|
|
254
338
|
|
|
@@ -258,8 +342,14 @@ smalltalk.method({
|
|
|
258
342
|
selector: "tearDown",
|
|
259
343
|
fn: function (){
|
|
260
344
|
var self=this;
|
|
261
|
-
(($receiver = self[
|
|
262
|
-
|
|
345
|
+
if(($receiver = self["@theClass"]) == nil || $receiver == undefined){
|
|
346
|
+
self["@theClass"];
|
|
347
|
+
} else {
|
|
348
|
+
smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_removeClass_",[self["@theClass"]]);
|
|
349
|
+
self["@theClass"]=nil;
|
|
350
|
+
self["@theClass"];
|
|
351
|
+
};
|
|
352
|
+
return self}
|
|
263
353
|
}),
|
|
264
354
|
smalltalk.ClassBuilderTest);
|
|
265
355
|
|
|
@@ -269,60 +359,1104 @@ smalltalk.method({
|
|
|
269
359
|
selector: "testClassCopy",
|
|
270
360
|
fn: function (){
|
|
271
361
|
var self=this;
|
|
272
|
-
|
|
273
|
-
smalltalk.send(self,
|
|
274
|
-
smalltalk.send(self,
|
|
275
|
-
smalltalk.send(self,
|
|
276
|
-
smalltalk.send(self,
|
|
277
|
-
smalltalk.send(self,
|
|
278
|
-
return self
|
|
362
|
+
self["@theClass"]=smalltalk.send(self["@builder"],"_copyClass_named_",[(smalltalk.ObjectMock || ObjectMock),"ObjectMock2"]);
|
|
363
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_superclass",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_superclass",[])])]);
|
|
364
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_instanceVariableNames",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_instanceVariableNames",[])])]);
|
|
365
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(self["@theClass"],"_name",[]),"ObjectMock2"]);
|
|
366
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(self["@theClass"],"_package",[]),"__eq_eq",[smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_package",[])])]);
|
|
367
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self["@theClass"],"_methodDictionary",[]),"_keys",[]),smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_methodDictionary",[]),"_keys",[])]);
|
|
368
|
+
return self}
|
|
369
|
+
}),
|
|
370
|
+
smalltalk.ClassBuilderTest);
|
|
371
|
+
|
|
372
|
+
smalltalk.addMethod(
|
|
373
|
+
"_testInstanceVariableNames",
|
|
374
|
+
smalltalk.method({
|
|
375
|
+
selector: "testInstanceVariableNames",
|
|
376
|
+
fn: function (){
|
|
377
|
+
var self=this;
|
|
378
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(self["@builder"],"_instanceVariableNamesFor_",[" hello world "]),["hello", "world"]]);
|
|
379
|
+
return self}
|
|
279
380
|
}),
|
|
280
381
|
smalltalk.ClassBuilderTest);
|
|
281
382
|
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
smalltalk.addClass('CollectionTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
386
|
+
smalltalk.addMethod(
|
|
387
|
+
"_assertSameContents_as_",
|
|
388
|
+
smalltalk.method({
|
|
389
|
+
selector: "assertSameContents:as:",
|
|
390
|
+
fn: function (aCollection,anotherCollection){
|
|
391
|
+
var self=this;
|
|
392
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(aCollection,"_size",[]),"__eq",[smalltalk.send(anotherCollection,"_size",[])])]);
|
|
393
|
+
smalltalk.send(aCollection,"_do_",[(function(each){
|
|
394
|
+
return smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(aCollection,"_occurrencesOf_",[each]),"__eq",[smalltalk.send(anotherCollection,"_occurrencesOf_",[each])])]);
|
|
395
|
+
})]);
|
|
396
|
+
return self}
|
|
397
|
+
}),
|
|
398
|
+
smalltalk.CollectionTest);
|
|
399
|
+
|
|
400
|
+
smalltalk.addMethod(
|
|
401
|
+
"_collection",
|
|
402
|
+
smalltalk.method({
|
|
403
|
+
selector: "collection",
|
|
404
|
+
fn: function (){
|
|
405
|
+
var self=this;
|
|
406
|
+
var $1;
|
|
407
|
+
$1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_withAll_",[smalltalk.send(self,"_defaultValues",[])]);
|
|
408
|
+
return $1;
|
|
409
|
+
}
|
|
410
|
+
}),
|
|
411
|
+
smalltalk.CollectionTest);
|
|
412
|
+
|
|
413
|
+
smalltalk.addMethod(
|
|
414
|
+
"_collectionClass",
|
|
415
|
+
smalltalk.method({
|
|
416
|
+
selector: "collectionClass",
|
|
417
|
+
fn: function (){
|
|
418
|
+
var self=this;
|
|
419
|
+
var $1;
|
|
420
|
+
$1=smalltalk.send(smalltalk.send(self,"_class",[]),"_collectionClass",[]);
|
|
421
|
+
return $1;
|
|
422
|
+
}
|
|
423
|
+
}),
|
|
424
|
+
smalltalk.CollectionTest);
|
|
425
|
+
|
|
426
|
+
smalltalk.addMethod(
|
|
427
|
+
"_collectionWithDuplicates",
|
|
428
|
+
smalltalk.method({
|
|
429
|
+
selector: "collectionWithDuplicates",
|
|
430
|
+
fn: function (){
|
|
431
|
+
var self=this;
|
|
432
|
+
var $1;
|
|
433
|
+
$1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_withAll_",[["a", "b", "c", (1), (2), (1), "a"]]);
|
|
434
|
+
return $1;
|
|
435
|
+
}
|
|
436
|
+
}),
|
|
437
|
+
smalltalk.CollectionTest);
|
|
438
|
+
|
|
439
|
+
smalltalk.addMethod(
|
|
440
|
+
"_defaultValues",
|
|
441
|
+
smalltalk.method({
|
|
442
|
+
selector: "defaultValues",
|
|
443
|
+
fn: function (){
|
|
444
|
+
var self=this;
|
|
445
|
+
return [(1), (2), (3), (-4)];
|
|
446
|
+
}
|
|
447
|
+
}),
|
|
448
|
+
smalltalk.CollectionTest);
|
|
449
|
+
|
|
450
|
+
smalltalk.addMethod(
|
|
451
|
+
"_isCollectionReadOnly",
|
|
452
|
+
smalltalk.method({
|
|
453
|
+
selector: "isCollectionReadOnly",
|
|
454
|
+
fn: function (){
|
|
455
|
+
var self=this;
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
}),
|
|
459
|
+
smalltalk.CollectionTest);
|
|
460
|
+
|
|
461
|
+
smalltalk.addMethod(
|
|
462
|
+
"_testAsArray",
|
|
463
|
+
smalltalk.method({
|
|
464
|
+
selector: "testAsArray",
|
|
465
|
+
fn: function (){
|
|
466
|
+
var self=this;
|
|
467
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),smalltalk.send(smalltalk.send(self,"_collection",[]),"_asArray",[])]);
|
|
468
|
+
return self}
|
|
469
|
+
}),
|
|
470
|
+
smalltalk.CollectionTest);
|
|
471
|
+
|
|
472
|
+
smalltalk.addMethod(
|
|
473
|
+
"_testAsOrderedCollection",
|
|
474
|
+
smalltalk.method({
|
|
475
|
+
selector: "testAsOrderedCollection",
|
|
476
|
+
fn: function (){
|
|
477
|
+
var self=this;
|
|
478
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),smalltalk.send(smalltalk.send(self,"_collection",[]),"_asOrderedCollection",[])]);
|
|
479
|
+
return self}
|
|
480
|
+
}),
|
|
481
|
+
smalltalk.CollectionTest);
|
|
482
|
+
|
|
483
|
+
smalltalk.addMethod(
|
|
484
|
+
"_testAsSet",
|
|
485
|
+
smalltalk.method({
|
|
486
|
+
selector: "testAsSet",
|
|
487
|
+
fn: function (){
|
|
488
|
+
var self=this;
|
|
489
|
+
var c;
|
|
490
|
+
var set;
|
|
491
|
+
c=smalltalk.send(self,"_collectionWithDuplicates",[]);
|
|
492
|
+
set=smalltalk.send(c,"_asSet",[]);
|
|
493
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(5)])]);
|
|
494
|
+
smalltalk.send(c,"_do_",[(function(each){
|
|
495
|
+
return smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[each])]);
|
|
496
|
+
})]);
|
|
497
|
+
return self}
|
|
498
|
+
}),
|
|
499
|
+
smalltalk.CollectionTest);
|
|
500
|
+
|
|
501
|
+
smalltalk.addMethod(
|
|
502
|
+
"_testCollect",
|
|
503
|
+
smalltalk.method({
|
|
504
|
+
selector: "testCollect",
|
|
505
|
+
fn: function (){
|
|
506
|
+
var self=this;
|
|
507
|
+
var newCollection;
|
|
508
|
+
newCollection=[(1), (2), (3), (4)];
|
|
509
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
|
|
510
|
+
return smalltalk.send(each,"_abs",[]);
|
|
511
|
+
})]),newCollection]);
|
|
512
|
+
return self}
|
|
513
|
+
}),
|
|
514
|
+
smalltalk.CollectionTest);
|
|
515
|
+
|
|
516
|
+
smalltalk.addMethod(
|
|
517
|
+
"_testDetect",
|
|
518
|
+
smalltalk.method({
|
|
519
|
+
selector: "testDetect",
|
|
520
|
+
fn: function (){
|
|
521
|
+
var self=this;
|
|
522
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
523
|
+
return smalltalk.send(each,"__lt",[(0)]);
|
|
524
|
+
})]),"__eq",[(-4)])]);
|
|
525
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
526
|
+
return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
527
|
+
return smalltalk.send(each,"__eq",[(6)]);
|
|
528
|
+
})]);
|
|
529
|
+
}),(smalltalk.Error || Error)]);
|
|
530
|
+
return self}
|
|
531
|
+
}),
|
|
532
|
+
smalltalk.CollectionTest);
|
|
533
|
+
|
|
534
|
+
smalltalk.addMethod(
|
|
535
|
+
"_testDo",
|
|
536
|
+
smalltalk.method({
|
|
537
|
+
selector: "testDo",
|
|
538
|
+
fn: function (){
|
|
539
|
+
var self=this;
|
|
540
|
+
var newCollection;
|
|
541
|
+
newCollection=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_new",[]);
|
|
542
|
+
smalltalk.send(smalltalk.send(self,"_collection",[]),"_do_",[(function(each){
|
|
543
|
+
return smalltalk.send(newCollection,"_add_",[each]);
|
|
544
|
+
})]);
|
|
545
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(self,"_collection",[]),newCollection]);
|
|
546
|
+
return self}
|
|
547
|
+
}),
|
|
548
|
+
smalltalk.CollectionTest);
|
|
549
|
+
|
|
550
|
+
smalltalk.addMethod(
|
|
551
|
+
"_testIsEmpty",
|
|
552
|
+
smalltalk.method({
|
|
553
|
+
selector: "testIsEmpty",
|
|
554
|
+
fn: function (){
|
|
555
|
+
var self=this;
|
|
556
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_new",[]),"_isEmpty",[])]);
|
|
557
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_isEmpty",[])]);
|
|
558
|
+
return self}
|
|
559
|
+
}),
|
|
560
|
+
smalltalk.CollectionTest);
|
|
561
|
+
|
|
562
|
+
smalltalk.addMethod(
|
|
563
|
+
"_testSelect",
|
|
564
|
+
smalltalk.method({
|
|
565
|
+
selector: "testSelect",
|
|
566
|
+
fn: function (){
|
|
567
|
+
var self=this;
|
|
568
|
+
var newCollection;
|
|
569
|
+
newCollection=[(2), (-4)];
|
|
570
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
|
|
571
|
+
return smalltalk.send(each,"_even",[]);
|
|
572
|
+
})]),newCollection]);
|
|
573
|
+
return self}
|
|
574
|
+
}),
|
|
575
|
+
smalltalk.CollectionTest);
|
|
576
|
+
|
|
577
|
+
smalltalk.addMethod(
|
|
578
|
+
"_testSize",
|
|
579
|
+
smalltalk.method({
|
|
580
|
+
selector: "testSize",
|
|
581
|
+
fn: function (){
|
|
582
|
+
var self=this;
|
|
583
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_new",[]),"_size",[]),"__eq",[(0)])]);
|
|
584
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_size",[]),"__eq",[(4)])]);
|
|
585
|
+
return self}
|
|
586
|
+
}),
|
|
587
|
+
smalltalk.CollectionTest);
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
smalltalk.addMethod(
|
|
591
|
+
"_collectionClass",
|
|
592
|
+
smalltalk.method({
|
|
593
|
+
selector: "collectionClass",
|
|
594
|
+
fn: function (){
|
|
595
|
+
var self=this;
|
|
596
|
+
return nil;
|
|
597
|
+
}
|
|
598
|
+
}),
|
|
599
|
+
smalltalk.CollectionTest.klass);
|
|
600
|
+
|
|
601
|
+
smalltalk.addMethod(
|
|
602
|
+
"_isAbstract",
|
|
603
|
+
smalltalk.method({
|
|
604
|
+
selector: "isAbstract",
|
|
605
|
+
fn: function (){
|
|
606
|
+
var self=this;
|
|
607
|
+
var $1;
|
|
608
|
+
$1=smalltalk.send(smalltalk.send(self,"_collectionClass",[]),"_isNil",[]);
|
|
609
|
+
return $1;
|
|
610
|
+
}
|
|
611
|
+
}),
|
|
612
|
+
smalltalk.CollectionTest.klass);
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
smalltalk.addClass('HashedCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
|
|
616
|
+
smalltalk.addMethod(
|
|
617
|
+
"_collection",
|
|
618
|
+
smalltalk.method({
|
|
619
|
+
selector: "collection",
|
|
620
|
+
fn: function (){
|
|
621
|
+
var self=this;
|
|
622
|
+
var $1;
|
|
623
|
+
$1=smalltalk.HashedCollection._fromPairs_([smalltalk.send("a","__minus_gt",[(1)]),smalltalk.send("b","__minus_gt",[(2)]),smalltalk.send("c","__minus_gt",[(3)]),smalltalk.send("d","__minus_gt",[(-4)])]);
|
|
624
|
+
return $1;
|
|
625
|
+
}
|
|
626
|
+
}),
|
|
627
|
+
smalltalk.HashedCollectionTest);
|
|
628
|
+
|
|
629
|
+
smalltalk.addMethod(
|
|
630
|
+
"_collectionWithDuplicates",
|
|
631
|
+
smalltalk.method({
|
|
632
|
+
selector: "collectionWithDuplicates",
|
|
633
|
+
fn: function (){
|
|
634
|
+
var self=this;
|
|
635
|
+
var $1;
|
|
636
|
+
$1=smalltalk.HashedCollection._fromPairs_([smalltalk.send("a","__minus_gt",[(1)]),smalltalk.send("b","__minus_gt",[(2)]),smalltalk.send("c","__minus_gt",[(3)]),smalltalk.send("d","__minus_gt",[(-4)]),smalltalk.send("e","__minus_gt",[(1)]),smalltalk.send("f","__minus_gt",[(2)]),smalltalk.send("g","__minus_gt",[(10)])]);
|
|
637
|
+
return $1;
|
|
638
|
+
}
|
|
639
|
+
}),
|
|
640
|
+
smalltalk.HashedCollectionTest);
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
smalltalk.addMethod(
|
|
644
|
+
"_collectionClass",
|
|
645
|
+
smalltalk.method({
|
|
646
|
+
selector: "collectionClass",
|
|
647
|
+
fn: function (){
|
|
648
|
+
var self=this;
|
|
649
|
+
return (smalltalk.HashedCollection || HashedCollection);
|
|
650
|
+
}
|
|
651
|
+
}),
|
|
652
|
+
smalltalk.HashedCollectionTest.klass);
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
smalltalk.addClass('DictionaryTest', smalltalk.HashedCollectionTest, [], 'Kernel-Tests');
|
|
656
|
+
smalltalk.addMethod(
|
|
657
|
+
"_collection",
|
|
658
|
+
smalltalk.method({
|
|
659
|
+
selector: "collection",
|
|
660
|
+
fn: function (){
|
|
661
|
+
var self=this;
|
|
662
|
+
var $2,$3,$1;
|
|
663
|
+
$2=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
664
|
+
smalltalk.send($2,"_at_put_",[(1),(1)]);
|
|
665
|
+
smalltalk.send($2,"_at_put_",["a",(2)]);
|
|
666
|
+
smalltalk.send($2,"_at_put_",[true,(3)]);
|
|
667
|
+
smalltalk.send($2,"_at_put_",[(4),(-4)]);
|
|
668
|
+
$3=smalltalk.send($2,"_yourself",[]);
|
|
669
|
+
$1=$3;
|
|
670
|
+
return $1;
|
|
671
|
+
}
|
|
672
|
+
}),
|
|
673
|
+
smalltalk.DictionaryTest);
|
|
674
|
+
|
|
675
|
+
smalltalk.addMethod(
|
|
676
|
+
"_collectionWithDuplicates",
|
|
677
|
+
smalltalk.method({
|
|
678
|
+
selector: "collectionWithDuplicates",
|
|
679
|
+
fn: function (){
|
|
680
|
+
var self=this;
|
|
681
|
+
var $2,$3,$1;
|
|
682
|
+
$2=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
683
|
+
smalltalk.send($2,"_at_put_",[(1),(1)]);
|
|
684
|
+
smalltalk.send($2,"_at_put_",["a",(2)]);
|
|
685
|
+
smalltalk.send($2,"_at_put_",[true,(3)]);
|
|
686
|
+
smalltalk.send($2,"_at_put_",[(4),(-4)]);
|
|
687
|
+
smalltalk.send($2,"_at_put_",["b",(1)]);
|
|
688
|
+
smalltalk.send($2,"_at_put_",[(3),(3)]);
|
|
689
|
+
smalltalk.send($2,"_at_put_",[false,(12)]);
|
|
690
|
+
$3=smalltalk.send($2,"_yourself",[]);
|
|
691
|
+
$1=$3;
|
|
692
|
+
return $1;
|
|
693
|
+
}
|
|
694
|
+
}),
|
|
695
|
+
smalltalk.DictionaryTest);
|
|
696
|
+
|
|
697
|
+
smalltalk.addMethod(
|
|
698
|
+
"_testAccessing",
|
|
699
|
+
smalltalk.method({
|
|
700
|
+
selector: "testAccessing",
|
|
701
|
+
fn: function (){
|
|
702
|
+
var self=this;
|
|
703
|
+
var d;
|
|
704
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
705
|
+
smalltalk.send(d,"_at_put_",["hello","world"]);
|
|
706
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",["hello"]),"__eq",["world"])]);
|
|
707
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_ifAbsent_",["hello",(function(){
|
|
708
|
+
return nil;
|
|
709
|
+
})]),"__eq",["world"])]);
|
|
710
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(d,"_at_ifAbsent_",["foo",(function(){
|
|
711
|
+
return nil;
|
|
712
|
+
})]),"__eq",["world"])]);
|
|
713
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
714
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",[(1)]),"__eq",[(2)])]);
|
|
715
|
+
smalltalk.send(d,"_at_put_",[smalltalk.send((1),"__at",[(3)]),(3)]);
|
|
716
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_at_",[smalltalk.send((1),"__at",[(3)])]),"__eq",[(3)])]);
|
|
717
|
+
return self}
|
|
718
|
+
}),
|
|
719
|
+
smalltalk.DictionaryTest);
|
|
720
|
+
|
|
721
|
+
smalltalk.addMethod(
|
|
722
|
+
"_testDynamicDictionaries",
|
|
723
|
+
smalltalk.method({
|
|
724
|
+
selector: "testDynamicDictionaries",
|
|
725
|
+
fn: function (){
|
|
726
|
+
var self=this;
|
|
727
|
+
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)])])])]);
|
|
728
|
+
return self}
|
|
729
|
+
}),
|
|
730
|
+
smalltalk.DictionaryTest);
|
|
731
|
+
|
|
732
|
+
smalltalk.addMethod(
|
|
733
|
+
"_testEquality",
|
|
734
|
+
smalltalk.method({
|
|
735
|
+
selector: "testEquality",
|
|
736
|
+
fn: function (){
|
|
737
|
+
var self=this;
|
|
738
|
+
var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
|
|
739
|
+
var d1;
|
|
740
|
+
var d2;
|
|
741
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]),"__eq",[smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[])])]);
|
|
742
|
+
$1=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
743
|
+
smalltalk.send($1,"_at_put_",[(1),(2)]);
|
|
744
|
+
$2=smalltalk.send($1,"_yourself",[]);
|
|
745
|
+
d1=$2;
|
|
746
|
+
$3=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
747
|
+
smalltalk.send($3,"_at_put_",[(1),(2)]);
|
|
748
|
+
$4=smalltalk.send($3,"_yourself",[]);
|
|
749
|
+
d2=$4;
|
|
750
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(d1,"__eq",[d2])]);
|
|
751
|
+
$5=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
752
|
+
smalltalk.send($5,"_at_put_",[(1),(3)]);
|
|
753
|
+
$6=smalltalk.send($5,"_yourself",[]);
|
|
754
|
+
d2=$6;
|
|
755
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
|
|
756
|
+
$7=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
757
|
+
smalltalk.send($7,"_at_put_",[(2),(2)]);
|
|
758
|
+
$8=smalltalk.send($7,"_yourself",[]);
|
|
759
|
+
d2=$8;
|
|
760
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
|
|
761
|
+
$9=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
762
|
+
smalltalk.send($9,"_at_put_",[(1),(2)]);
|
|
763
|
+
smalltalk.send($9,"_at_put_",[(3),(4)]);
|
|
764
|
+
$10=smalltalk.send($9,"_yourself",[]);
|
|
765
|
+
d2=$10;
|
|
766
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(d1,"__eq",[d2])]);
|
|
767
|
+
return self}
|
|
768
|
+
}),
|
|
769
|
+
smalltalk.DictionaryTest);
|
|
770
|
+
|
|
771
|
+
smalltalk.addMethod(
|
|
772
|
+
"_testIfAbsent",
|
|
773
|
+
smalltalk.method({
|
|
774
|
+
selector: "testIfAbsent",
|
|
775
|
+
fn: function (){
|
|
776
|
+
var self=this;
|
|
777
|
+
var d;
|
|
778
|
+
var visited;
|
|
779
|
+
visited=false;
|
|
780
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
781
|
+
smalltalk.send(d,"_at_ifAbsent_",["hello",(function(){
|
|
782
|
+
visited=true;
|
|
783
|
+
return visited;
|
|
784
|
+
})]);
|
|
785
|
+
smalltalk.send(self,"_assert_",[visited]);
|
|
786
|
+
return self}
|
|
787
|
+
}),
|
|
788
|
+
smalltalk.DictionaryTest);
|
|
789
|
+
|
|
790
|
+
smalltalk.addMethod(
|
|
791
|
+
"_testIfPresent",
|
|
792
|
+
smalltalk.method({
|
|
793
|
+
selector: "testIfPresent",
|
|
794
|
+
fn: function (){
|
|
795
|
+
var self=this;
|
|
796
|
+
var d;
|
|
797
|
+
var visited;
|
|
798
|
+
var absent;
|
|
799
|
+
visited=false;
|
|
800
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
801
|
+
smalltalk.send(d,"_at_put_",["hello","world"]);
|
|
802
|
+
smalltalk.send(d,"_at_ifPresent_",["hello",(function(value){
|
|
803
|
+
visited=value;
|
|
804
|
+
return visited;
|
|
805
|
+
})]);
|
|
806
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(visited,"__eq",["world"])]);
|
|
807
|
+
absent=smalltalk.send(d,"_at_ifPresent_",["bye",(function(value){
|
|
808
|
+
visited=value;
|
|
809
|
+
return visited;
|
|
810
|
+
})]);
|
|
811
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(absent,"_isNil",[])]);
|
|
812
|
+
return self}
|
|
813
|
+
}),
|
|
814
|
+
smalltalk.DictionaryTest);
|
|
815
|
+
|
|
816
|
+
smalltalk.addMethod(
|
|
817
|
+
"_testIfPresentIfAbsent",
|
|
818
|
+
smalltalk.method({
|
|
819
|
+
selector: "testIfPresentIfAbsent",
|
|
820
|
+
fn: function (){
|
|
821
|
+
var self=this;
|
|
822
|
+
var d;
|
|
823
|
+
var visited;
|
|
824
|
+
visited=false;
|
|
825
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
826
|
+
smalltalk.send(d,"_at_put_",["hello","world"]);
|
|
827
|
+
smalltalk.send(d,"_at_ifPresent_ifAbsent_",["hello",(function(value){
|
|
828
|
+
visited=value;
|
|
829
|
+
return visited;
|
|
830
|
+
}),(function(){
|
|
831
|
+
visited=true;
|
|
832
|
+
return visited;
|
|
833
|
+
})]);
|
|
834
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(visited,"__eq",["world"])]);
|
|
835
|
+
smalltalk.send(d,"_at_ifPresent_ifAbsent_",["buy",(function(value){
|
|
836
|
+
visited=value;
|
|
837
|
+
return visited;
|
|
838
|
+
}),(function(){
|
|
839
|
+
visited=true;
|
|
840
|
+
return visited;
|
|
841
|
+
})]);
|
|
842
|
+
smalltalk.send(self,"_assert_",[visited]);
|
|
843
|
+
return self}
|
|
844
|
+
}),
|
|
845
|
+
smalltalk.DictionaryTest);
|
|
846
|
+
|
|
847
|
+
smalltalk.addMethod(
|
|
848
|
+
"_testKeys",
|
|
849
|
+
smalltalk.method({
|
|
850
|
+
selector: "testKeys",
|
|
851
|
+
fn: function (){
|
|
852
|
+
var self=this;
|
|
853
|
+
var d;
|
|
854
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
855
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
856
|
+
smalltalk.send(d,"_at_put_",[(2),(3)]);
|
|
857
|
+
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
|
858
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (2), (3)]])]);
|
|
859
|
+
return self}
|
|
860
|
+
}),
|
|
861
|
+
smalltalk.DictionaryTest);
|
|
862
|
+
|
|
863
|
+
smalltalk.addMethod(
|
|
864
|
+
"_testPrintString",
|
|
865
|
+
smalltalk.method({
|
|
866
|
+
selector: "testPrintString",
|
|
867
|
+
fn: function (){
|
|
868
|
+
var self=this;
|
|
869
|
+
var $1,$2;
|
|
870
|
+
$1=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
871
|
+
smalltalk.send($1,"_at_put_",["firstname","James"]);
|
|
872
|
+
smalltalk.send($1,"_at_put_",["lastname","Bond"]);
|
|
873
|
+
$2=smalltalk.send($1,"_printString",[]);
|
|
874
|
+
smalltalk.send(self,"_assert_equals_",["a Dictionary('firstname'->'James' , 'lastname'->'Bond')",$2]);
|
|
875
|
+
return self}
|
|
876
|
+
}),
|
|
877
|
+
smalltalk.DictionaryTest);
|
|
878
|
+
|
|
879
|
+
smalltalk.addMethod(
|
|
880
|
+
"_testRemoveKey",
|
|
881
|
+
smalltalk.method({
|
|
882
|
+
selector: "testRemoveKey",
|
|
883
|
+
fn: function (){
|
|
884
|
+
var self=this;
|
|
885
|
+
var d;
|
|
886
|
+
var key;
|
|
887
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
888
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
889
|
+
smalltalk.send(d,"_at_put_",[(2),(3)]);
|
|
890
|
+
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
|
891
|
+
key=(2);
|
|
892
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (2), (3)]])]);
|
|
893
|
+
smalltalk.send(d,"_removeKey_",[key]);
|
|
894
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_keys",[]),"__eq",[[(1), (3)]])]);
|
|
895
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_values",[]),"__eq",[[(2), (4)]])]);
|
|
896
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(d,"_includesKey_",[(2)])]);
|
|
897
|
+
return self}
|
|
898
|
+
}),
|
|
899
|
+
smalltalk.DictionaryTest);
|
|
900
|
+
|
|
901
|
+
smalltalk.addMethod(
|
|
902
|
+
"_testRemoveKeyIfAbsent",
|
|
903
|
+
smalltalk.method({
|
|
904
|
+
selector: "testRemoveKeyIfAbsent",
|
|
905
|
+
fn: function (){
|
|
906
|
+
var self=this;
|
|
907
|
+
var d;
|
|
908
|
+
var key;
|
|
909
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
910
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
911
|
+
smalltalk.send(d,"_at_put_",[(2),(3)]);
|
|
912
|
+
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
|
913
|
+
key=(2);
|
|
914
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_",[key]),"__eq",[(3)])]);
|
|
915
|
+
key=(3);
|
|
916
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_ifAbsent_",[key,(function(){
|
|
917
|
+
return (42);
|
|
918
|
+
})]),"__eq",[(4)])]);
|
|
919
|
+
key="why";
|
|
920
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_removeKey_ifAbsent_",[key,(function(){
|
|
921
|
+
return (42);
|
|
922
|
+
})]),"__eq",[(42)])]);
|
|
923
|
+
return self}
|
|
924
|
+
}),
|
|
925
|
+
smalltalk.DictionaryTest);
|
|
926
|
+
|
|
927
|
+
smalltalk.addMethod(
|
|
928
|
+
"_testSize",
|
|
929
|
+
smalltalk.method({
|
|
930
|
+
selector: "testSize",
|
|
931
|
+
fn: function (){
|
|
932
|
+
var self=this;
|
|
933
|
+
var d;
|
|
934
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
935
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(0)])]);
|
|
936
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
937
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(1)])]);
|
|
938
|
+
smalltalk.send(d,"_at_put_",[(2),(3)]);
|
|
939
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_size",[]),"__eq",[(2)])]);
|
|
940
|
+
return self}
|
|
941
|
+
}),
|
|
942
|
+
smalltalk.DictionaryTest);
|
|
943
|
+
|
|
944
|
+
smalltalk.addMethod(
|
|
945
|
+
"_testValues",
|
|
946
|
+
smalltalk.method({
|
|
947
|
+
selector: "testValues",
|
|
948
|
+
fn: function (){
|
|
949
|
+
var self=this;
|
|
950
|
+
var d;
|
|
951
|
+
d=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
|
|
952
|
+
smalltalk.send(d,"_at_put_",[(1),(2)]);
|
|
953
|
+
smalltalk.send(d,"_at_put_",[(2),(3)]);
|
|
954
|
+
smalltalk.send(d,"_at_put_",[(3),(4)]);
|
|
955
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(d,"_values",[]),"__eq",[[(2), (3), (4)]])]);
|
|
956
|
+
return self}
|
|
957
|
+
}),
|
|
958
|
+
smalltalk.DictionaryTest);
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
smalltalk.addMethod(
|
|
962
|
+
"_collectionClass",
|
|
963
|
+
smalltalk.method({
|
|
964
|
+
selector: "collectionClass",
|
|
965
|
+
fn: function (){
|
|
966
|
+
var self=this;
|
|
967
|
+
return (smalltalk.Dictionary || Dictionary);
|
|
968
|
+
}
|
|
969
|
+
}),
|
|
970
|
+
smalltalk.DictionaryTest.klass);
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
smalltalk.addClass('SequenceableCollectionTest', smalltalk.CollectionTest, [], 'Kernel-Tests');
|
|
974
|
+
smalltalk.addMethod(
|
|
975
|
+
"_testAt",
|
|
976
|
+
smalltalk.method({
|
|
977
|
+
selector: "testAt",
|
|
978
|
+
fn: function (){
|
|
979
|
+
var self=this;
|
|
980
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_",[(4)]),"__eq",[(-4)])]);
|
|
981
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
982
|
+
return smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_",[(5)]);
|
|
983
|
+
}),(smalltalk.Error || Error)]);
|
|
984
|
+
return self}
|
|
985
|
+
}),
|
|
986
|
+
smalltalk.SequenceableCollectionTest);
|
|
987
|
+
|
|
988
|
+
smalltalk.addMethod(
|
|
989
|
+
"_testAtIfAbsent",
|
|
990
|
+
smalltalk.method({
|
|
991
|
+
selector: "testAtIfAbsent",
|
|
992
|
+
fn: function (){
|
|
993
|
+
var self=this;
|
|
994
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_at_ifAbsent_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_size",[]),"__plus",[(1)]),(function(){
|
|
995
|
+
return "none";
|
|
996
|
+
})]),"__eq",["none"])]);
|
|
997
|
+
return self}
|
|
998
|
+
}),
|
|
999
|
+
smalltalk.SequenceableCollectionTest);
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
smalltalk.addClass('ArrayTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
|
|
1004
|
+
smalltalk.addMethod(
|
|
1005
|
+
"_testAtIfAbsent",
|
|
1006
|
+
smalltalk.method({
|
|
1007
|
+
selector: "testAtIfAbsent",
|
|
1008
|
+
fn: function (){
|
|
1009
|
+
var self=this;
|
|
1010
|
+
var array;
|
|
1011
|
+
array=["hello", "world"];
|
|
1012
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_",[(1)]),"hello"]);
|
|
1013
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_",[(2)]),"world"]);
|
|
1014
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(2),(function(){
|
|
1015
|
+
return "not found";
|
|
1016
|
+
})]),"world"]);
|
|
1017
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(0),(function(){
|
|
1018
|
+
return "not found";
|
|
1019
|
+
})]),"not found"]);
|
|
1020
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(-10),(function(){
|
|
1021
|
+
return "not found";
|
|
1022
|
+
})]),"not found"]);
|
|
1023
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(array,"_at_ifAbsent_",[(3),(function(){
|
|
1024
|
+
return "not found";
|
|
1025
|
+
})]),"not found"]);
|
|
1026
|
+
return self}
|
|
1027
|
+
}),
|
|
1028
|
+
smalltalk.ArrayTest);
|
|
1029
|
+
|
|
1030
|
+
smalltalk.addMethod(
|
|
1031
|
+
"_testFirstN",
|
|
1032
|
+
smalltalk.method({
|
|
1033
|
+
selector: "testFirstN",
|
|
1034
|
+
fn: function (){
|
|
1035
|
+
var self=this;
|
|
1036
|
+
smalltalk.send(self,"_assert_equals_",[[(1),(2),(3)],smalltalk.send([(1),(2),(3),(4),(5)],"_first_",[(3)])]);
|
|
1037
|
+
return self}
|
|
1038
|
+
}),
|
|
1039
|
+
smalltalk.ArrayTest);
|
|
1040
|
+
|
|
1041
|
+
smalltalk.addMethod(
|
|
1042
|
+
"_testIfEmpty",
|
|
1043
|
+
smalltalk.method({
|
|
1044
|
+
selector: "testIfEmpty",
|
|
1045
|
+
fn: function (){
|
|
1046
|
+
var self=this;
|
|
1047
|
+
smalltalk.send(self,"_assert_equals_",["zork",smalltalk.send("","_ifEmpty_",[(function(){
|
|
1048
|
+
return "zork";
|
|
1049
|
+
})])]);
|
|
1050
|
+
return self}
|
|
1051
|
+
}),
|
|
1052
|
+
smalltalk.ArrayTest);
|
|
1053
|
+
|
|
1054
|
+
smalltalk.addMethod(
|
|
1055
|
+
"_testPrintString",
|
|
1056
|
+
smalltalk.method({
|
|
1057
|
+
selector: "testPrintString",
|
|
1058
|
+
fn: function (){
|
|
1059
|
+
var self=this;
|
|
1060
|
+
var $1,$2;
|
|
1061
|
+
var array;
|
|
1062
|
+
array=smalltalk.send((smalltalk.Array || Array),"_new",[]);
|
|
1063
|
+
smalltalk.send(self,"_assert_equals_",["a Array ()",smalltalk.send(array,"_printString",[])]);
|
|
1064
|
+
smalltalk.send(array,"_add_",[(1)]);
|
|
1065
|
+
$1=smalltalk.send(array,"_add_",[(3)]);
|
|
1066
|
+
smalltalk.send(self,"_assert_equals_",["a Array (1 3)",smalltalk.send(array,"_printString",[])]);
|
|
1067
|
+
smalltalk.send(array,"_add_",["foo"]);
|
|
1068
|
+
smalltalk.send(self,"_assert_equals_",["a Array (1 3 'foo')",smalltalk.send(array,"_printString",[])]);
|
|
1069
|
+
smalltalk.send(array,"_remove_",[(1)]);
|
|
1070
|
+
$2=smalltalk.send(array,"_remove_",[(3)]);
|
|
1071
|
+
smalltalk.send(self,"_assert_equals_",["a Array ('foo')",smalltalk.send(array,"_printString",[])]);
|
|
1072
|
+
smalltalk.send(array,"_addLast_",[(3)]);
|
|
1073
|
+
smalltalk.send(self,"_assert_equals_",["a Array ('foo' 3)",smalltalk.send(array,"_printString",[])]);
|
|
1074
|
+
smalltalk.send(array,"_addLast_",[(3)]);
|
|
1075
|
+
smalltalk.send(self,"_assert_equals_",["a Array ('foo' 3 3)",smalltalk.send(array,"_printString",[])]);
|
|
1076
|
+
return self}
|
|
1077
|
+
}),
|
|
1078
|
+
smalltalk.ArrayTest);
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
smalltalk.addMethod(
|
|
1082
|
+
"_collectionClass",
|
|
1083
|
+
smalltalk.method({
|
|
1084
|
+
selector: "collectionClass",
|
|
1085
|
+
fn: function (){
|
|
1086
|
+
var self=this;
|
|
1087
|
+
return (smalltalk.Array || Array);
|
|
1088
|
+
}
|
|
1089
|
+
}),
|
|
1090
|
+
smalltalk.ArrayTest.klass);
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
smalltalk.addClass('StringTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
|
|
1094
|
+
smalltalk.addMethod(
|
|
1095
|
+
"_collection",
|
|
1096
|
+
smalltalk.method({
|
|
1097
|
+
selector: "collection",
|
|
1098
|
+
fn: function (){
|
|
1099
|
+
var self=this;
|
|
1100
|
+
return "hello";
|
|
1101
|
+
}
|
|
1102
|
+
}),
|
|
1103
|
+
smalltalk.StringTest);
|
|
1104
|
+
|
|
1105
|
+
smalltalk.addMethod(
|
|
1106
|
+
"_collectionWithDuplicates",
|
|
1107
|
+
smalltalk.method({
|
|
1108
|
+
selector: "collectionWithDuplicates",
|
|
1109
|
+
fn: function (){
|
|
1110
|
+
var self=this;
|
|
1111
|
+
return "abbaerte";
|
|
1112
|
+
}
|
|
1113
|
+
}),
|
|
1114
|
+
smalltalk.StringTest);
|
|
1115
|
+
|
|
1116
|
+
smalltalk.addMethod(
|
|
1117
|
+
"_testAddRemove",
|
|
1118
|
+
smalltalk.method({
|
|
1119
|
+
selector: "testAddRemove",
|
|
1120
|
+
fn: function (){
|
|
1121
|
+
var self=this;
|
|
1122
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1123
|
+
return smalltalk.send("hello","_add_",["a"]);
|
|
1124
|
+
}),(smalltalk.Error || Error)]);
|
|
1125
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1126
|
+
return smalltalk.send("hello","_remove_",["h"]);
|
|
1127
|
+
}),(smalltalk.Error || Error)]);
|
|
1128
|
+
return self}
|
|
1129
|
+
}),
|
|
1130
|
+
smalltalk.StringTest);
|
|
1131
|
+
|
|
1132
|
+
smalltalk.addMethod(
|
|
1133
|
+
"_testAsArray",
|
|
1134
|
+
smalltalk.method({
|
|
1135
|
+
selector: "testAsArray",
|
|
1136
|
+
fn: function (){
|
|
1137
|
+
var self=this;
|
|
1138
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_asArray",[]),"__eq",[["h", "e", "l", "l", "o"]])]);
|
|
1139
|
+
return self}
|
|
1140
|
+
}),
|
|
1141
|
+
smalltalk.StringTest);
|
|
1142
|
+
|
|
1143
|
+
smalltalk.addMethod(
|
|
1144
|
+
"_testAt",
|
|
1145
|
+
smalltalk.method({
|
|
1146
|
+
selector: "testAt",
|
|
1147
|
+
fn: function (){
|
|
1148
|
+
var self=this;
|
|
1149
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_",[(1)]),"__eq",["h"])]);
|
|
1150
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_",[(5)]),"__eq",["o"])]);
|
|
1151
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_at_ifAbsent_",[(6),(function(){
|
|
1152
|
+
return nil;
|
|
1153
|
+
})]),"__eq",[nil])]);
|
|
1154
|
+
return self}
|
|
1155
|
+
}),
|
|
1156
|
+
smalltalk.StringTest);
|
|
1157
|
+
|
|
1158
|
+
smalltalk.addMethod(
|
|
1159
|
+
"_testAtPut",
|
|
1160
|
+
smalltalk.method({
|
|
1161
|
+
selector: "testAtPut",
|
|
1162
|
+
fn: function (){
|
|
1163
|
+
var self=this;
|
|
1164
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1165
|
+
return smalltalk.send("hello","_at_put_",[(1),"a"]);
|
|
1166
|
+
}),(smalltalk.Error || Error)]);
|
|
1167
|
+
return self}
|
|
1168
|
+
}),
|
|
1169
|
+
smalltalk.StringTest);
|
|
1170
|
+
|
|
1171
|
+
smalltalk.addMethod(
|
|
1172
|
+
"_testCollect",
|
|
1173
|
+
smalltalk.method({
|
|
1174
|
+
selector: "testCollect",
|
|
1175
|
+
fn: function (){
|
|
1176
|
+
var self=this;
|
|
1177
|
+
var newCollection;
|
|
1178
|
+
newCollection="hheelllloo";
|
|
1179
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
|
|
1180
|
+
return smalltalk.send(each,"__comma",[each]);
|
|
1181
|
+
})]),newCollection]);
|
|
1182
|
+
return self}
|
|
1183
|
+
}),
|
|
1184
|
+
smalltalk.StringTest);
|
|
1185
|
+
|
|
1186
|
+
smalltalk.addMethod(
|
|
1187
|
+
"_testCopyWithoutAll",
|
|
1188
|
+
smalltalk.method({
|
|
1189
|
+
selector: "testCopyWithoutAll",
|
|
1190
|
+
fn: function (){
|
|
1191
|
+
var self=this;
|
|
1192
|
+
smalltalk.send(self,"_assert_equals_",["hello world",smalltalk.send("*hello* *world*","_copyWithoutAll_",["*"])]);
|
|
1193
|
+
return self}
|
|
1194
|
+
}),
|
|
1195
|
+
smalltalk.StringTest);
|
|
1196
|
+
|
|
1197
|
+
smalltalk.addMethod(
|
|
1198
|
+
"_testDetect",
|
|
1199
|
+
smalltalk.method({
|
|
1200
|
+
selector: "testDetect",
|
|
1201
|
+
fn: function (){
|
|
1202
|
+
var self=this;
|
|
1203
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
1204
|
+
return smalltalk.send(each,"__eq",["h"]);
|
|
1205
|
+
})]),"__eq",["h"])]);
|
|
1206
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1207
|
+
return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
1208
|
+
return smalltalk.send(each,"__eq",[(6)]);
|
|
1209
|
+
})]);
|
|
1210
|
+
}),(smalltalk.Error || Error)]);
|
|
1211
|
+
return self}
|
|
1212
|
+
}),
|
|
1213
|
+
smalltalk.StringTest);
|
|
1214
|
+
|
|
1215
|
+
smalltalk.addMethod(
|
|
1216
|
+
"_testEquality",
|
|
1217
|
+
smalltalk.method({
|
|
1218
|
+
selector: "testEquality",
|
|
1219
|
+
fn: function (){
|
|
1220
|
+
var self=this;
|
|
1221
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq",["hello"])]);
|
|
1222
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq",["world"])]);
|
|
1223
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq",[smalltalk.send("hello","_yourself",[])])]);
|
|
1224
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_yourself",[]),"__eq",["hello"])]);
|
|
1225
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[(0)])]);
|
|
1226
|
+
return self}
|
|
1227
|
+
}),
|
|
1228
|
+
smalltalk.StringTest);
|
|
1229
|
+
|
|
1230
|
+
smalltalk.addMethod(
|
|
1231
|
+
"_testIdentity",
|
|
1232
|
+
smalltalk.method({
|
|
1233
|
+
selector: "testIdentity",
|
|
1234
|
+
fn: function (){
|
|
1235
|
+
var self=this;
|
|
1236
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq_eq",["hello"])]);
|
|
1237
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq_eq",["world"])]);
|
|
1238
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("hello","__eq_eq",[smalltalk.send("hello","_yourself",[])])]);
|
|
1239
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("hello","_yourself",[]),"__eq_eq",["hello"])]);
|
|
1240
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("","__eq_eq",[(0)])]);
|
|
1241
|
+
return self}
|
|
1242
|
+
}),
|
|
1243
|
+
smalltalk.StringTest);
|
|
1244
|
+
|
|
1245
|
+
smalltalk.addMethod(
|
|
1246
|
+
"_testIncludesSubString",
|
|
1247
|
+
smalltalk.method({
|
|
1248
|
+
selector: "testIncludesSubString",
|
|
1249
|
+
fn: function (){
|
|
1250
|
+
var self=this;
|
|
1251
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("amber","_includesSubString_",["ber"])]);
|
|
1252
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("amber","_includesSubString_",["zork"])]);
|
|
1253
|
+
return self}
|
|
1254
|
+
}),
|
|
1255
|
+
smalltalk.StringTest);
|
|
1256
|
+
|
|
1257
|
+
smalltalk.addMethod(
|
|
1258
|
+
"_testJoin",
|
|
1259
|
+
smalltalk.method({
|
|
1260
|
+
selector: "testJoin",
|
|
1261
|
+
fn: function (){
|
|
1262
|
+
var self=this;
|
|
1263
|
+
smalltalk.send(self,"_assert_equals_",["hello,world",smalltalk.send(",","_join_",[["hello", "world"]])]);
|
|
1264
|
+
return self}
|
|
1265
|
+
}),
|
|
1266
|
+
smalltalk.StringTest);
|
|
1267
|
+
|
|
1268
|
+
smalltalk.addMethod(
|
|
1269
|
+
"_testSelect",
|
|
1270
|
+
smalltalk.method({
|
|
1271
|
+
selector: "testSelect",
|
|
1272
|
+
fn: function (){
|
|
1273
|
+
var self=this;
|
|
1274
|
+
var newCollection;
|
|
1275
|
+
newCollection="o";
|
|
1276
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
|
|
1277
|
+
return smalltalk.send(each,"__eq",["o"]);
|
|
1278
|
+
})]),newCollection]);
|
|
1279
|
+
return self}
|
|
1280
|
+
}),
|
|
1281
|
+
smalltalk.StringTest);
|
|
1282
|
+
|
|
1283
|
+
smalltalk.addMethod(
|
|
1284
|
+
"_testSize",
|
|
1285
|
+
smalltalk.method({
|
|
1286
|
+
selector: "testSize",
|
|
1287
|
+
fn: function (){
|
|
1288
|
+
var self=this;
|
|
1289
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send("smalltalk","_size",[]),(9)]);
|
|
1290
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send("","_size",[]),(0)]);
|
|
1291
|
+
return self}
|
|
1292
|
+
}),
|
|
1293
|
+
smalltalk.StringTest);
|
|
1294
|
+
|
|
1295
|
+
smalltalk.addMethod(
|
|
1296
|
+
"_testStreamContents",
|
|
1297
|
+
smalltalk.method({
|
|
1298
|
+
selector: "testStreamContents",
|
|
1299
|
+
fn: function (){
|
|
1300
|
+
var self=this;
|
|
1301
|
+
var $1;
|
|
1302
|
+
smalltalk.send(self,"_assert_equals_",["hello world",smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(aStream){
|
|
1303
|
+
smalltalk.send(aStream,"_nextPutAll_",["hello"]);
|
|
1304
|
+
smalltalk.send(aStream,"_space",[]);
|
|
1305
|
+
$1=smalltalk.send(aStream,"_nextPutAll_",["world"]);
|
|
1306
|
+
return $1;
|
|
1307
|
+
})])]);
|
|
1308
|
+
return self}
|
|
1309
|
+
}),
|
|
1310
|
+
smalltalk.StringTest);
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
smalltalk.addMethod(
|
|
1314
|
+
"_collectionClass",
|
|
1315
|
+
smalltalk.method({
|
|
1316
|
+
selector: "collectionClass",
|
|
1317
|
+
fn: function (){
|
|
1318
|
+
var self=this;
|
|
1319
|
+
return (smalltalk.String || String);
|
|
1320
|
+
}
|
|
1321
|
+
}),
|
|
1322
|
+
smalltalk.StringTest.klass);
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
smalltalk.addClass('SymbolTest', smalltalk.SequenceableCollectionTest, [], 'Kernel-Tests');
|
|
1326
|
+
smalltalk.addMethod(
|
|
1327
|
+
"_collection",
|
|
1328
|
+
smalltalk.method({
|
|
1329
|
+
selector: "collection",
|
|
1330
|
+
fn: function (){
|
|
1331
|
+
var self=this;
|
|
1332
|
+
return smalltalk.symbolFor("hello");
|
|
1333
|
+
}
|
|
1334
|
+
}),
|
|
1335
|
+
smalltalk.SymbolTest);
|
|
1336
|
+
|
|
1337
|
+
smalltalk.addMethod(
|
|
1338
|
+
"_collectionWithDuplicates",
|
|
1339
|
+
smalltalk.method({
|
|
1340
|
+
selector: "collectionWithDuplicates",
|
|
1341
|
+
fn: function (){
|
|
1342
|
+
var self=this;
|
|
1343
|
+
return smalltalk.symbolFor("phhaaarorra");
|
|
1344
|
+
}
|
|
1345
|
+
}),
|
|
1346
|
+
smalltalk.SymbolTest);
|
|
1347
|
+
|
|
1348
|
+
smalltalk.addMethod(
|
|
1349
|
+
"_testAsString",
|
|
1350
|
+
smalltalk.method({
|
|
1351
|
+
selector: "testAsString",
|
|
1352
|
+
fn: function (){
|
|
1353
|
+
var self=this;
|
|
1354
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("hello"),"_asString",[]),"hello"]);
|
|
1355
|
+
return self}
|
|
1356
|
+
}),
|
|
1357
|
+
smalltalk.SymbolTest);
|
|
1358
|
+
|
|
1359
|
+
smalltalk.addMethod(
|
|
1360
|
+
"_testAsSymbol",
|
|
1361
|
+
smalltalk.method({
|
|
1362
|
+
selector: "testAsSymbol",
|
|
1363
|
+
fn: function (){
|
|
1364
|
+
var self=this;
|
|
1365
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_asSymbol",[])])]);
|
|
1366
|
+
return self}
|
|
1367
|
+
}),
|
|
1368
|
+
smalltalk.SymbolTest);
|
|
1369
|
+
|
|
1370
|
+
smalltalk.addMethod(
|
|
1371
|
+
"_testAt",
|
|
1372
|
+
smalltalk.method({
|
|
1373
|
+
selector: "testAt",
|
|
1374
|
+
fn: function (){
|
|
1375
|
+
var self=this;
|
|
1376
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_",[(1)]),"__eq",["h"])]);
|
|
1377
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_",[(5)]),"__eq",["o"])]);
|
|
1378
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_at_ifAbsent_",[(6),(function(){
|
|
1379
|
+
return nil;
|
|
1380
|
+
})]),"__eq",[nil])]);
|
|
1381
|
+
return self}
|
|
1382
|
+
}),
|
|
1383
|
+
smalltalk.SymbolTest);
|
|
1384
|
+
|
|
1385
|
+
smalltalk.addMethod(
|
|
1386
|
+
"_testAtPut",
|
|
1387
|
+
smalltalk.method({
|
|
1388
|
+
selector: "testAtPut",
|
|
1389
|
+
fn: function (){
|
|
1390
|
+
var self=this;
|
|
1391
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1392
|
+
return smalltalk.send("hello","_at_put_",[(1),"a"]);
|
|
1393
|
+
}),(smalltalk.Error || Error)]);
|
|
1394
|
+
return self}
|
|
1395
|
+
}),
|
|
1396
|
+
smalltalk.SymbolTest);
|
|
1397
|
+
|
|
1398
|
+
smalltalk.addMethod(
|
|
1399
|
+
"_testCollect",
|
|
1400
|
+
smalltalk.method({
|
|
1401
|
+
selector: "testCollect",
|
|
1402
|
+
fn: function (){
|
|
1403
|
+
var self=this;
|
|
1404
|
+
var newCollection;
|
|
1405
|
+
newCollection=smalltalk.symbolFor("hheelllloo");
|
|
1406
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_collect_",[(function(each){
|
|
1407
|
+
return smalltalk.send(each,"__comma",[each]);
|
|
1408
|
+
})]),newCollection]);
|
|
1409
|
+
return self}
|
|
1410
|
+
}),
|
|
1411
|
+
smalltalk.SymbolTest);
|
|
1412
|
+
|
|
282
1413
|
smalltalk.addMethod(
|
|
283
|
-
"
|
|
1414
|
+
"_testComparing",
|
|
284
1415
|
smalltalk.method({
|
|
285
|
-
selector: "
|
|
1416
|
+
selector: "testComparing",
|
|
286
1417
|
fn: function (){
|
|
287
1418
|
var self=this;
|
|
288
|
-
smalltalk.send(self,
|
|
289
|
-
|
|
1419
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt",[smalltalk.symbolFor("aa")])]);
|
|
1420
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt",[smalltalk.symbolFor("ba")])]);
|
|
1421
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__lt",[smalltalk.symbolFor("ba")])]);
|
|
1422
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("bb"),"__lt",[smalltalk.symbolFor("ba")])]);
|
|
1423
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt_eq",[smalltalk.symbolFor("aa")])]);
|
|
1424
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("ab"),"__gt_eq",[smalltalk.symbolFor("ba")])]);
|
|
1425
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("ab"),"__lt_eq",[smalltalk.symbolFor("ba")])]);
|
|
1426
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("bb"),"__lt_eq",[smalltalk.symbolFor("ba")])]);
|
|
1427
|
+
return self}
|
|
290
1428
|
}),
|
|
291
|
-
smalltalk.
|
|
292
|
-
|
|
293
|
-
|
|
1429
|
+
smalltalk.SymbolTest);
|
|
294
1430
|
|
|
295
|
-
smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
296
1431
|
smalltalk.addMethod(
|
|
297
|
-
"
|
|
1432
|
+
"_testCopying",
|
|
298
1433
|
smalltalk.method({
|
|
299
|
-
selector: "
|
|
1434
|
+
selector: "testCopying",
|
|
300
1435
|
fn: function (){
|
|
301
1436
|
var self=this;
|
|
302
|
-
|
|
303
|
-
(
|
|
304
|
-
|
|
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;}
|
|
1437
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_copy",[]),"__eq_eq",[smalltalk.symbolFor("hello")])]);
|
|
1438
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_deepCopy",[]),"__eq_eq",[smalltalk.symbolFor("hello")])]);
|
|
1439
|
+
return self}
|
|
313
1440
|
}),
|
|
314
|
-
smalltalk.
|
|
1441
|
+
smalltalk.SymbolTest);
|
|
315
1442
|
|
|
316
1443
|
smalltalk.addMethod(
|
|
317
|
-
"
|
|
1444
|
+
"_testDetect",
|
|
318
1445
|
smalltalk.method({
|
|
319
|
-
selector: "
|
|
1446
|
+
selector: "testDetect",
|
|
320
1447
|
fn: function (){
|
|
321
1448
|
var self=this;
|
|
322
|
-
smalltalk.send(self,
|
|
323
|
-
return
|
|
1449
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
1450
|
+
return smalltalk.send(each,"__eq",["h"]);
|
|
1451
|
+
})]),"__eq",["h"])]);
|
|
1452
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1453
|
+
return smalltalk.send(smalltalk.send(self,"_collection",[]),"_detect_",[(function(each){
|
|
1454
|
+
return smalltalk.send(each,"__eq",["z"]);
|
|
1455
|
+
})]);
|
|
1456
|
+
}),(smalltalk.Error || Error)]);
|
|
1457
|
+
return self}
|
|
324
1458
|
}),
|
|
325
|
-
smalltalk.
|
|
1459
|
+
smalltalk.SymbolTest);
|
|
326
1460
|
|
|
327
1461
|
smalltalk.addMethod(
|
|
328
1462
|
"_testEquality",
|
|
@@ -330,92 +1464,70 @@ smalltalk.method({
|
|
|
330
1464
|
selector: "testEquality",
|
|
331
1465
|
fn: function (){
|
|
332
1466
|
var self=this;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
smalltalk.send(self,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
smalltalk.send(self,
|
|
339
|
-
|
|
340
|
-
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
|
341
|
-
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(2), (2)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
|
342
|
-
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
|
343
|
-
(d2=(function($rec){smalltalk.send($rec, "_at_put_", [(1), (2)]);smalltalk.send($rec, "_at_put_", [(3), (4)]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", [])));
|
|
344
|
-
smalltalk.send(self, "_deny_", [smalltalk.send(d1, "__eq", [d2])]);
|
|
345
|
-
return self;}
|
|
1467
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.symbolFor("hello")])]);
|
|
1468
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.symbolFor("world")])]);
|
|
1469
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[])])]);
|
|
1470
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[]),"__eq",[smalltalk.symbolFor("hello")])]);
|
|
1471
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",["hello"])]);
|
|
1472
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("hello","__eq",[smalltalk.symbolFor("hello")])]);
|
|
1473
|
+
return self}
|
|
346
1474
|
}),
|
|
347
|
-
smalltalk.
|
|
1475
|
+
smalltalk.SymbolTest);
|
|
348
1476
|
|
|
349
1477
|
smalltalk.addMethod(
|
|
350
|
-
"
|
|
1478
|
+
"_testIdentity",
|
|
351
1479
|
smalltalk.method({
|
|
352
|
-
selector: "
|
|
1480
|
+
selector: "testIdentity",
|
|
353
1481
|
fn: function (){
|
|
354
1482
|
var self=this;
|
|
355
|
-
|
|
356
|
-
(
|
|
357
|
-
smalltalk.send(
|
|
358
|
-
smalltalk.send(
|
|
359
|
-
|
|
360
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_keys", []), "__eq", [[(1), (2), (3)]])]);
|
|
361
|
-
return self;}
|
|
1483
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.symbolFor("hello")])]);
|
|
1484
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq_eq",[smalltalk.symbolFor("world")])]);
|
|
1485
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"__eq",[smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[])])]);
|
|
1486
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_yourself",[]),"__eq",[smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"),"_asString",[]),"_asSymbol",[])])]);
|
|
1487
|
+
return self}
|
|
362
1488
|
}),
|
|
363
|
-
smalltalk.
|
|
1489
|
+
smalltalk.SymbolTest);
|
|
364
1490
|
|
|
365
1491
|
smalltalk.addMethod(
|
|
366
|
-
"
|
|
1492
|
+
"_testIsEmpty",
|
|
367
1493
|
smalltalk.method({
|
|
368
|
-
selector: "
|
|
1494
|
+
selector: "testIsEmpty",
|
|
369
1495
|
fn: function (){
|
|
370
1496
|
var self=this;
|
|
371
|
-
smalltalk.send(self,
|
|
372
|
-
|
|
1497
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_isEmpty",[])]);
|
|
1498
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send("","_asSymbol",[]),"_isEmpty",[])]);
|
|
1499
|
+
return self}
|
|
373
1500
|
}),
|
|
374
|
-
smalltalk.
|
|
1501
|
+
smalltalk.SymbolTest);
|
|
375
1502
|
|
|
376
1503
|
smalltalk.addMethod(
|
|
377
|
-
"
|
|
1504
|
+
"_testIsSymbolIsString",
|
|
378
1505
|
smalltalk.method({
|
|
379
|
-
selector: "
|
|
1506
|
+
selector: "testIsSymbolIsString",
|
|
380
1507
|
fn: function (){
|
|
381
1508
|
var self=this;
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
(
|
|
385
|
-
smalltalk.send(
|
|
386
|
-
|
|
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)])]);
|
|
394
|
-
return self;}
|
|
1509
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.symbolFor("hello"),"_isSymbol",[])]);
|
|
1510
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("hello","_isSymbol",[])]);
|
|
1511
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.symbolFor("hello"),"_isString",[])]);
|
|
1512
|
+
smalltalk.send(self,"_assert_",[smalltalk.send("hello","_isString",[])]);
|
|
1513
|
+
return self}
|
|
395
1514
|
}),
|
|
396
|
-
smalltalk.
|
|
1515
|
+
smalltalk.SymbolTest);
|
|
397
1516
|
|
|
398
1517
|
smalltalk.addMethod(
|
|
399
|
-
"
|
|
1518
|
+
"_testSelect",
|
|
400
1519
|
smalltalk.method({
|
|
401
|
-
selector: "
|
|
1520
|
+
selector: "testSelect",
|
|
402
1521
|
fn: function (){
|
|
403
1522
|
var self=this;
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
(
|
|
407
|
-
smalltalk.send(
|
|
408
|
-
|
|
409
|
-
|
|
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)])]);
|
|
416
|
-
return self;}
|
|
1523
|
+
var newCollection;
|
|
1524
|
+
newCollection="o";
|
|
1525
|
+
smalltalk.send(self,"_assertSameContents_as_",[smalltalk.send(smalltalk.send(self,"_collection",[]),"_select_",[(function(each){
|
|
1526
|
+
return smalltalk.send(each,"__eq",["o"]);
|
|
1527
|
+
})]),newCollection]);
|
|
1528
|
+
return self}
|
|
417
1529
|
}),
|
|
418
|
-
smalltalk.
|
|
1530
|
+
smalltalk.SymbolTest);
|
|
419
1531
|
|
|
420
1532
|
smalltalk.addMethod(
|
|
421
1533
|
"_testSize",
|
|
@@ -423,33 +1535,23 @@ smalltalk.method({
|
|
|
423
1535
|
selector: "testSize",
|
|
424
1536
|
fn: function (){
|
|
425
1537
|
var self=this;
|
|
426
|
-
|
|
427
|
-
(
|
|
428
|
-
|
|
429
|
-
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
|
430
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(1)])]);
|
|
431
|
-
smalltalk.send(d, "_at_put_", [(2), (3)]);
|
|
432
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_size", []), "__eq", [(2)])]);
|
|
433
|
-
return self;}
|
|
1538
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("a"),"_size",[]),(1)]);
|
|
1539
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.symbolFor("aaaaa"),"_size",[]),(5)]);
|
|
1540
|
+
return self}
|
|
434
1541
|
}),
|
|
435
|
-
smalltalk.
|
|
1542
|
+
smalltalk.SymbolTest);
|
|
1543
|
+
|
|
436
1544
|
|
|
437
1545
|
smalltalk.addMethod(
|
|
438
|
-
"
|
|
1546
|
+
"_collectionClass",
|
|
439
1547
|
smalltalk.method({
|
|
440
|
-
selector: "
|
|
1548
|
+
selector: "collectionClass",
|
|
441
1549
|
fn: function (){
|
|
442
1550
|
var self=this;
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
smalltalk.send(d, "_at_put_", [(1), (2)]);
|
|
446
|
-
smalltalk.send(d, "_at_put_", [(2), (3)]);
|
|
447
|
-
smalltalk.send(d, "_at_put_", [(3), (4)]);
|
|
448
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(d, "_values", []), "__eq", [[(2), (3), (4)]])]);
|
|
449
|
-
return self;}
|
|
1551
|
+
return (smalltalk.Symbol || Symbol);
|
|
1552
|
+
}
|
|
450
1553
|
}),
|
|
451
|
-
smalltalk.
|
|
452
|
-
|
|
1554
|
+
smalltalk.SymbolTest.klass);
|
|
453
1555
|
|
|
454
1556
|
|
|
455
1557
|
smalltalk.addClass('JSObjectProxyTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
@@ -459,8 +1561,9 @@ smalltalk.method({
|
|
|
459
1561
|
selector: "jsObject",
|
|
460
1562
|
fn: function (){
|
|
461
1563
|
var self=this;
|
|
462
|
-
return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
|
|
463
|
-
|
|
1564
|
+
return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: ''};
|
|
1565
|
+
;
|
|
1566
|
+
return self}
|
|
464
1567
|
}),
|
|
465
1568
|
smalltalk.JSObjectProxyTest);
|
|
466
1569
|
|
|
@@ -470,8 +1573,10 @@ smalltalk.method({
|
|
|
470
1573
|
selector: "testDNU",
|
|
471
1574
|
fn: function (){
|
|
472
1575
|
var self=this;
|
|
473
|
-
smalltalk.send(self,
|
|
474
|
-
return self;
|
|
1576
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1577
|
+
return smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_foo",[]);
|
|
1578
|
+
}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
|
|
1579
|
+
return self}
|
|
475
1580
|
}),
|
|
476
1581
|
smalltalk.JSObjectProxyTest);
|
|
477
1582
|
|
|
@@ -481,10 +1586,10 @@ smalltalk.method({
|
|
|
481
1586
|
selector: "testMessageSend",
|
|
482
1587
|
fn: function (){
|
|
483
1588
|
var self=this;
|
|
484
|
-
smalltalk.send(self,
|
|
485
|
-
smalltalk.send(self,
|
|
486
|
-
smalltalk.send(self,
|
|
487
|
-
return self
|
|
1589
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_a",[]),(1)]);
|
|
1590
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_b",[]),(2)]);
|
|
1591
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_c_",[(3)]),(3)]);
|
|
1592
|
+
return self}
|
|
488
1593
|
}),
|
|
489
1594
|
smalltalk.JSObjectProxyTest);
|
|
490
1595
|
|
|
@@ -494,12 +1599,8 @@ smalltalk.method({
|
|
|
494
1599
|
selector: "testMethodWithArguments",
|
|
495
1600
|
fn: function (){
|
|
496
1601
|
var self=this;
|
|
497
|
-
smalltalk.send(self,
|
|
498
|
-
|
|
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"])]);
|
|
502
|
-
return self;}
|
|
1602
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_c_",[(1)]),(1)]);
|
|
1603
|
+
return self}
|
|
503
1604
|
}),
|
|
504
1605
|
smalltalk.JSObjectProxyTest);
|
|
505
1606
|
|
|
@@ -509,8 +1610,8 @@ smalltalk.method({
|
|
|
509
1610
|
selector: "testPrinting",
|
|
510
1611
|
fn: function (){
|
|
511
1612
|
var self=this;
|
|
512
|
-
smalltalk.send(self,
|
|
513
|
-
return self
|
|
1613
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_jsObject",[]),"_printString",[]),"__eq",["[object Object]"])]);
|
|
1614
|
+
return self}
|
|
514
1615
|
}),
|
|
515
1616
|
smalltalk.JSObjectProxyTest);
|
|
516
1617
|
|
|
@@ -520,11 +1621,12 @@ smalltalk.method({
|
|
|
520
1621
|
selector: "testPropertyThatReturnsEmptyString",
|
|
521
1622
|
fn: function (){
|
|
522
1623
|
var self=this;
|
|
523
|
-
|
|
524
|
-
smalltalk.send(self,
|
|
525
|
-
smalltalk.send(smalltalk.send(
|
|
526
|
-
smalltalk.send(
|
|
527
|
-
|
|
1624
|
+
var object;
|
|
1625
|
+
object=smalltalk.send(self,"_jsObject",[]);
|
|
1626
|
+
smalltalk.send(self,"_assert_equals_",["",smalltalk.send(object,"_d",[])]);
|
|
1627
|
+
smalltalk.send(object,"_d_",["hello"]);
|
|
1628
|
+
smalltalk.send(self,"_assert_equals_",["hello",smalltalk.send(object,"_d",[])]);
|
|
1629
|
+
return self}
|
|
528
1630
|
}),
|
|
529
1631
|
smalltalk.JSObjectProxyTest);
|
|
530
1632
|
|
|
@@ -534,32 +1636,46 @@ smalltalk.method({
|
|
|
534
1636
|
selector: "testYourself",
|
|
535
1637
|
fn: function (){
|
|
536
1638
|
var self=this;
|
|
537
|
-
var
|
|
538
|
-
|
|
539
|
-
smalltalk.send(self,
|
|
540
|
-
smalltalk.send(
|
|
541
|
-
smalltalk.send(
|
|
542
|
-
|
|
1639
|
+
var $1,$2;
|
|
1640
|
+
var object;
|
|
1641
|
+
$1=smalltalk.send(self,"_jsObject",[]);
|
|
1642
|
+
smalltalk.send($1,"_d_",["test"]);
|
|
1643
|
+
$2=smalltalk.send($1,"_yourself",[]);
|
|
1644
|
+
object=$2;
|
|
1645
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(object,"_d",[]),"test"]);
|
|
1646
|
+
return self}
|
|
543
1647
|
}),
|
|
544
1648
|
smalltalk.JSObjectProxyTest);
|
|
545
1649
|
|
|
546
1650
|
|
|
547
1651
|
|
|
548
1652
|
smalltalk.addClass('NumberTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
1653
|
+
smalltalk.addMethod(
|
|
1654
|
+
"_testAbs",
|
|
1655
|
+
smalltalk.method({
|
|
1656
|
+
selector: "testAbs",
|
|
1657
|
+
fn: function (){
|
|
1658
|
+
var self=this;
|
|
1659
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_abs",[]),"__eq",[(4)])]);
|
|
1660
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-4),"_abs",[]),"__eq",[(4)])]);
|
|
1661
|
+
return self}
|
|
1662
|
+
}),
|
|
1663
|
+
smalltalk.NumberTest);
|
|
1664
|
+
|
|
549
1665
|
smalltalk.addMethod(
|
|
550
1666
|
"_testArithmetic",
|
|
551
1667
|
smalltalk.method({
|
|
552
1668
|
selector: "testArithmetic",
|
|
553
1669
|
fn: function (){
|
|
554
1670
|
var self=this;
|
|
555
|
-
smalltalk.send(self,
|
|
556
|
-
smalltalk.send(self,
|
|
557
|
-
smalltalk.send(self,
|
|
558
|
-
smalltalk.send(self,
|
|
559
|
-
smalltalk.send(self,
|
|
560
|
-
smalltalk.send(self,
|
|
561
|
-
smalltalk.send(self,
|
|
562
|
-
return self
|
|
1671
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1.5),"__plus",[(1)]),"__eq",[(2.5)])]);
|
|
1672
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((2),"__minus",[(1)]),"__eq",[(1)])]);
|
|
1673
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-2),"__minus",[(1)]),"__eq",[(-3)])]);
|
|
1674
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((12),"__slash",[(2)]),"__eq",[(6)])]);
|
|
1675
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"__star",[(4)]),"__eq",[(12)])]);
|
|
1676
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send((1),"__plus",[(2)]),"__star",[(3)]),"__eq",[(9)])]);
|
|
1677
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"__plus",[smalltalk.send((2),"__star",[(3)])]),"__eq",[(7)])]);
|
|
1678
|
+
return self}
|
|
563
1679
|
}),
|
|
564
1680
|
smalltalk.NumberTest);
|
|
565
1681
|
|
|
@@ -569,15 +1685,15 @@ smalltalk.method({
|
|
|
569
1685
|
selector: "testComparison",
|
|
570
1686
|
fn: function (){
|
|
571
1687
|
var self=this;
|
|
572
|
-
smalltalk.send(self,
|
|
573
|
-
smalltalk.send(self,
|
|
574
|
-
smalltalk.send(self,
|
|
575
|
-
smalltalk.send(self,
|
|
576
|
-
smalltalk.send(self,
|
|
577
|
-
smalltalk.send(self,
|
|
578
|
-
smalltalk.send(self,
|
|
579
|
-
smalltalk.send(self,
|
|
580
|
-
return self
|
|
1688
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((3),"__gt",[(2)])]);
|
|
1689
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((2),"__lt",[(3)])]);
|
|
1690
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((3),"__lt",[(2)])]);
|
|
1691
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((2),"__gt",[(3)])]);
|
|
1692
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((3),"__gt_eq",[(3)])]);
|
|
1693
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((3.1),"__gt_eq",[(3)])]);
|
|
1694
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((3),"__lt_eq",[(3)])]);
|
|
1695
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((3),"__lt_eq",[(3.1)])]);
|
|
1696
|
+
return self}
|
|
581
1697
|
}),
|
|
582
1698
|
smalltalk.NumberTest);
|
|
583
1699
|
|
|
@@ -587,9 +1703,9 @@ smalltalk.method({
|
|
|
587
1703
|
selector: "testCopying",
|
|
588
1704
|
fn: function (){
|
|
589
1705
|
var self=this;
|
|
590
|
-
smalltalk.send(self,
|
|
591
|
-
smalltalk.send(self,
|
|
592
|
-
return self
|
|
1706
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_copy",[]),"__eq_eq",[(1)])]);
|
|
1707
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_deepCopy",[]),"__eq_eq",[(1)])]);
|
|
1708
|
+
return self}
|
|
593
1709
|
}),
|
|
594
1710
|
smalltalk.NumberTest);
|
|
595
1711
|
|
|
@@ -599,17 +1715,17 @@ smalltalk.method({
|
|
|
599
1715
|
selector: "testEquality",
|
|
600
1716
|
fn: function (){
|
|
601
1717
|
var self=this;
|
|
602
|
-
smalltalk.send(self,
|
|
603
|
-
smalltalk.send(self,
|
|
604
|
-
smalltalk.send(self,
|
|
605
|
-
smalltalk.send(self,
|
|
606
|
-
smalltalk.send(self,
|
|
607
|
-
smalltalk.send(self,
|
|
608
|
-
smalltalk.send(self,
|
|
609
|
-
smalltalk.send(self,
|
|
610
|
-
smalltalk.send(self,
|
|
611
|
-
smalltalk.send(self,
|
|
612
|
-
return self
|
|
1718
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq",[(1)])]);
|
|
1719
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((0),"__eq",[(0)])]);
|
|
1720
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq",[(0)])]);
|
|
1721
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq",[(1)])]);
|
|
1722
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq",[smalltalk.send((1),"_yourself",[])])]);
|
|
1723
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq",[smalltalk.send((1),"_yourself",[])])]);
|
|
1724
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[false])]);
|
|
1725
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(false,"__eq",[(0)])]);
|
|
1726
|
+
smalltalk.send(self,"_deny_",[smalltalk.send("","__eq",[(0)])]);
|
|
1727
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((0),"__eq",[""])]);
|
|
1728
|
+
return self}
|
|
613
1729
|
}),
|
|
614
1730
|
smalltalk.NumberTest);
|
|
615
1731
|
|
|
@@ -619,14 +1735,14 @@ smalltalk.method({
|
|
|
619
1735
|
selector: "testIdentity",
|
|
620
1736
|
fn: function (){
|
|
621
1737
|
var self=this;
|
|
622
|
-
smalltalk.send(self,
|
|
623
|
-
smalltalk.send(self,
|
|
624
|
-
smalltalk.send(self,
|
|
625
|
-
smalltalk.send(self,
|
|
626
|
-
smalltalk.send(self,
|
|
627
|
-
smalltalk.send(self,
|
|
628
|
-
smalltalk.send(self,
|
|
629
|
-
return self
|
|
1738
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq_eq",[(1)])]);
|
|
1739
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((0),"__eq_eq",[(0)])]);
|
|
1740
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq_eq",[(0)])]);
|
|
1741
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq_eq",[(1)])]);
|
|
1742
|
+
smalltalk.send(self,"_assert_",[smalltalk.send((1),"__eq_eq",[smalltalk.send((1),"_yourself",[])])]);
|
|
1743
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((1),"_yourself",[]),"__eq_eq",[smalltalk.send((1),"_yourself",[])])]);
|
|
1744
|
+
smalltalk.send(self,"_deny_",[smalltalk.send((1),"__eq_eq",[(2)])]);
|
|
1745
|
+
return self}
|
|
630
1746
|
}),
|
|
631
1747
|
smalltalk.NumberTest);
|
|
632
1748
|
|
|
@@ -636,9 +1752,9 @@ smalltalk.method({
|
|
|
636
1752
|
selector: "testMinMax",
|
|
637
1753
|
fn: function (){
|
|
638
1754
|
var self=this;
|
|
639
|
-
smalltalk.send(self,
|
|
640
|
-
smalltalk.send(self,
|
|
641
|
-
return self
|
|
1755
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((2),"_max_",[(5)]),(5)]);
|
|
1756
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((2),"_min_",[(5)]),(2)]);
|
|
1757
|
+
return self}
|
|
642
1758
|
}),
|
|
643
1759
|
smalltalk.NumberTest);
|
|
644
1760
|
|
|
@@ -648,9 +1764,9 @@ smalltalk.method({
|
|
|
648
1764
|
selector: "testNegated",
|
|
649
1765
|
fn: function (){
|
|
650
1766
|
var self=this;
|
|
651
|
-
smalltalk.send(self,
|
|
652
|
-
smalltalk.send(self,
|
|
653
|
-
return self
|
|
1767
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_negated",[]),"__eq",[(-3)])]);
|
|
1768
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((-3),"_negated",[]),"__eq",[(3)])]);
|
|
1769
|
+
return self}
|
|
654
1770
|
}),
|
|
655
1771
|
smalltalk.NumberTest);
|
|
656
1772
|
|
|
@@ -660,20 +1776,20 @@ smalltalk.method({
|
|
|
660
1776
|
selector: "testPrintShowingDecimalPlaces",
|
|
661
1777
|
fn: function (){
|
|
662
1778
|
var self=this;
|
|
663
|
-
smalltalk.send(self,
|
|
664
|
-
smalltalk.send(self,
|
|
665
|
-
smalltalk.send(self,
|
|
666
|
-
smalltalk.send(self,
|
|
667
|
-
smalltalk.send(self,
|
|
668
|
-
smalltalk.send(self,
|
|
669
|
-
smalltalk.send(self,
|
|
670
|
-
smalltalk.send(self,
|
|
671
|
-
smalltalk.send(self,
|
|
672
|
-
smalltalk.send(self,
|
|
673
|
-
smalltalk.send(self,
|
|
674
|
-
smalltalk.send(self,
|
|
675
|
-
smalltalk.send(self,
|
|
676
|
-
return self
|
|
1779
|
+
smalltalk.send(self,"_assert_equals_",["23.00",smalltalk.send((23),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1780
|
+
smalltalk.send(self,"_assert_equals_",["23.57",smalltalk.send((23.5698),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1781
|
+
smalltalk.send(self,"_assert_equals_",["-234.56700",smalltalk.send(smalltalk.send((234.567),"_negated",[]),"_printShowingDecimalPlaces_",[(5)])]);
|
|
1782
|
+
smalltalk.send(self,"_assert_equals_",["23",smalltalk.send((23.4567),"_printShowingDecimalPlaces_",[(0)])]);
|
|
1783
|
+
smalltalk.send(self,"_assert_equals_",["24",smalltalk.send((23.5567),"_printShowingDecimalPlaces_",[(0)])]);
|
|
1784
|
+
smalltalk.send(self,"_assert_equals_",["-23",smalltalk.send(smalltalk.send((23.4567),"_negated",[]),"_printShowingDecimalPlaces_",[(0)])]);
|
|
1785
|
+
smalltalk.send(self,"_assert_equals_",["-24",smalltalk.send(smalltalk.send((23.5567),"_negated",[]),"_printShowingDecimalPlaces_",[(0)])]);
|
|
1786
|
+
smalltalk.send(self,"_assert_equals_",["100000000.0",smalltalk.send((100000000),"_printShowingDecimalPlaces_",[(1)])]);
|
|
1787
|
+
smalltalk.send(self,"_assert_equals_",["0.98000",smalltalk.send((0.98),"_printShowingDecimalPlaces_",[(5)])]);
|
|
1788
|
+
smalltalk.send(self,"_assert_equals_",["-0.98",smalltalk.send(smalltalk.send((0.98),"_negated",[]),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1789
|
+
smalltalk.send(self,"_assert_equals_",["2.57",smalltalk.send((2.567),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1790
|
+
smalltalk.send(self,"_assert_equals_",["-2.57",smalltalk.send((-2.567),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1791
|
+
smalltalk.send(self,"_assert_equals_",["0.00",smalltalk.send((0),"_printShowingDecimalPlaces_",[(2)])]);
|
|
1792
|
+
return self}
|
|
677
1793
|
}),
|
|
678
1794
|
smalltalk.NumberTest);
|
|
679
1795
|
|
|
@@ -683,10 +1799,10 @@ smalltalk.method({
|
|
|
683
1799
|
selector: "testRounded",
|
|
684
1800
|
fn: function (){
|
|
685
1801
|
var self=this;
|
|
686
|
-
smalltalk.send(self,
|
|
687
|
-
smalltalk.send(self,
|
|
688
|
-
smalltalk.send(self,
|
|
689
|
-
return self
|
|
1802
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_rounded",[]),"__eq",[(3)])]);
|
|
1803
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.212),"_rounded",[]),"__eq",[(3)])]);
|
|
1804
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.51),"_rounded",[]),"__eq",[(4)])]);
|
|
1805
|
+
return self}
|
|
690
1806
|
}),
|
|
691
1807
|
smalltalk.NumberTest);
|
|
692
1808
|
|
|
@@ -696,9 +1812,9 @@ smalltalk.method({
|
|
|
696
1812
|
selector: "testSqrt",
|
|
697
1813
|
fn: function (){
|
|
698
1814
|
var self=this;
|
|
699
|
-
smalltalk.send(self,
|
|
700
|
-
smalltalk.send(self,
|
|
701
|
-
return self
|
|
1815
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_sqrt",[]),"__eq",[(2)])]);
|
|
1816
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((16),"_sqrt",[]),"__eq",[(4)])]);
|
|
1817
|
+
return self}
|
|
702
1818
|
}),
|
|
703
1819
|
smalltalk.NumberTest);
|
|
704
1820
|
|
|
@@ -708,8 +1824,8 @@ smalltalk.method({
|
|
|
708
1824
|
selector: "testSquared",
|
|
709
1825
|
fn: function (){
|
|
710
1826
|
var self=this;
|
|
711
|
-
smalltalk.send(self,
|
|
712
|
-
return self
|
|
1827
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((4),"_squared",[]),"__eq",[(16)])]);
|
|
1828
|
+
return self}
|
|
713
1829
|
}),
|
|
714
1830
|
smalltalk.NumberTest);
|
|
715
1831
|
|
|
@@ -719,13 +1835,19 @@ smalltalk.method({
|
|
|
719
1835
|
selector: "testTimesRepeat",
|
|
720
1836
|
fn: function (){
|
|
721
1837
|
var self=this;
|
|
722
|
-
var i
|
|
723
|
-
|
|
724
|
-
smalltalk.send((0),
|
|
725
|
-
smalltalk.send(
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
1838
|
+
var i;
|
|
1839
|
+
i=(0);
|
|
1840
|
+
smalltalk.send((0),"_timesRepeat_",[(function(){
|
|
1841
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
1842
|
+
return i;
|
|
1843
|
+
})]);
|
|
1844
|
+
smalltalk.send(self,"_assert_equals_",[i,(0)]);
|
|
1845
|
+
smalltalk.send((5),"_timesRepeat_",[(function(){
|
|
1846
|
+
i=smalltalk.send(i,"__plus",[(1)]);
|
|
1847
|
+
return i;
|
|
1848
|
+
})]);
|
|
1849
|
+
smalltalk.send(self,"_assert_equals_",[i,(5)]);
|
|
1850
|
+
return self}
|
|
729
1851
|
}),
|
|
730
1852
|
smalltalk.NumberTest);
|
|
731
1853
|
|
|
@@ -735,8 +1857,8 @@ smalltalk.method({
|
|
|
735
1857
|
selector: "testTo",
|
|
736
1858
|
fn: function (){
|
|
737
1859
|
var self=this;
|
|
738
|
-
smalltalk.send(self,
|
|
739
|
-
return self
|
|
1860
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((1),"_to_",[(5)]),[(1), (2), (3), (4), (5)]]);
|
|
1861
|
+
return self}
|
|
740
1862
|
}),
|
|
741
1863
|
smalltalk.NumberTest);
|
|
742
1864
|
|
|
@@ -746,9 +1868,11 @@ smalltalk.method({
|
|
|
746
1868
|
selector: "testToBy",
|
|
747
1869
|
fn: function (){
|
|
748
1870
|
var self=this;
|
|
749
|
-
smalltalk.send(self,
|
|
750
|
-
smalltalk.send(self,
|
|
751
|
-
return
|
|
1871
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((0),"_to_by_",[(6),(2)]),[(0), (2), (4), (6)]]);
|
|
1872
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1873
|
+
return smalltalk.send((1),"_to_by_",[(4),(0)]);
|
|
1874
|
+
}),(smalltalk.Error || Error)]);
|
|
1875
|
+
return self}
|
|
752
1876
|
}),
|
|
753
1877
|
smalltalk.NumberTest);
|
|
754
1878
|
|
|
@@ -758,10 +1882,10 @@ smalltalk.method({
|
|
|
758
1882
|
selector: "testTruncated",
|
|
759
1883
|
fn: function (){
|
|
760
1884
|
var self=this;
|
|
761
|
-
smalltalk.send(self,
|
|
762
|
-
smalltalk.send(self,
|
|
763
|
-
smalltalk.send(self,
|
|
764
|
-
return self
|
|
1885
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"_truncated",[]),"__eq",[(3)])]);
|
|
1886
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.212),"_truncated",[]),"__eq",[(3)])]);
|
|
1887
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3.51),"_truncated",[]),"__eq",[(3)])]);
|
|
1888
|
+
return self}
|
|
765
1889
|
}),
|
|
766
1890
|
smalltalk.NumberTest);
|
|
767
1891
|
|
|
@@ -774,8 +1898,8 @@ smalltalk.method({
|
|
|
774
1898
|
selector: "foo",
|
|
775
1899
|
fn: function (){
|
|
776
1900
|
var self=this;
|
|
777
|
-
return self[
|
|
778
|
-
|
|
1901
|
+
return self["@foo"];
|
|
1902
|
+
}
|
|
779
1903
|
}),
|
|
780
1904
|
smalltalk.ObjectMock);
|
|
781
1905
|
|
|
@@ -785,8 +1909,8 @@ smalltalk.method({
|
|
|
785
1909
|
selector: "foo:",
|
|
786
1910
|
fn: function (anObject){
|
|
787
1911
|
var self=this;
|
|
788
|
-
|
|
789
|
-
return self
|
|
1912
|
+
self["@foo"]=anObject;
|
|
1913
|
+
return self}
|
|
790
1914
|
}),
|
|
791
1915
|
smalltalk.ObjectMock);
|
|
792
1916
|
|
|
@@ -799,12 +1923,12 @@ smalltalk.method({
|
|
|
799
1923
|
selector: "testBasicAccess",
|
|
800
1924
|
fn: function (){
|
|
801
1925
|
var self=this;
|
|
802
|
-
var o
|
|
803
|
-
|
|
804
|
-
smalltalk.send(o,
|
|
805
|
-
smalltalk.send(self,
|
|
806
|
-
smalltalk.send(self,
|
|
807
|
-
return self
|
|
1926
|
+
var o;
|
|
1927
|
+
o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
1928
|
+
smalltalk.send(o,"_basicAt_put_",["a",(1)]);
|
|
1929
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicAt_",["a"]),(1)]);
|
|
1930
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicAt_",["b"]),nil]);
|
|
1931
|
+
return self}
|
|
808
1932
|
}),
|
|
809
1933
|
smalltalk.ObjectTest);
|
|
810
1934
|
|
|
@@ -814,13 +1938,17 @@ smalltalk.method({
|
|
|
814
1938
|
selector: "testBasicPerform",
|
|
815
1939
|
fn: function (){
|
|
816
1940
|
var self=this;
|
|
817
|
-
var o
|
|
818
|
-
|
|
819
|
-
smalltalk.send(o,
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
smalltalk.send(
|
|
823
|
-
return
|
|
1941
|
+
var o;
|
|
1942
|
+
o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
1943
|
+
smalltalk.send(o,"_basicAt_put_",["func",(function(){
|
|
1944
|
+
return "hello";
|
|
1945
|
+
})]);
|
|
1946
|
+
smalltalk.send(o,"_basicAt_put_",["func2",(function(a){
|
|
1947
|
+
return smalltalk.send(a,"__plus",[(1)]);
|
|
1948
|
+
})]);
|
|
1949
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicPerform_",["func"]),"hello"]);
|
|
1950
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_basicPerform_withArguments_",["func2",[(3)]]),(4)]);
|
|
1951
|
+
return self}
|
|
824
1952
|
}),
|
|
825
1953
|
smalltalk.ObjectTest);
|
|
826
1954
|
|
|
@@ -830,8 +1958,10 @@ smalltalk.method({
|
|
|
830
1958
|
selector: "testDNU",
|
|
831
1959
|
fn: function (){
|
|
832
1960
|
var self=this;
|
|
833
|
-
smalltalk.send(self,
|
|
834
|
-
return
|
|
1961
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1962
|
+
return smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_foo",[]);
|
|
1963
|
+
}),(smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
|
|
1964
|
+
return self}
|
|
835
1965
|
}),
|
|
836
1966
|
smalltalk.ObjectTest);
|
|
837
1967
|
|
|
@@ -841,13 +1971,13 @@ smalltalk.method({
|
|
|
841
1971
|
selector: "testEquality",
|
|
842
1972
|
fn: function (){
|
|
843
1973
|
var self=this;
|
|
844
|
-
var o
|
|
845
|
-
|
|
846
|
-
smalltalk.send(self,
|
|
847
|
-
smalltalk.send(self,
|
|
848
|
-
smalltalk.send(self,
|
|
849
|
-
smalltalk.send(self,
|
|
850
|
-
return self
|
|
1974
|
+
var o;
|
|
1975
|
+
o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
1976
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(o,"__eq",[smalltalk.send((smalltalk.Object || Object),"_new",[])])]);
|
|
1977
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq",[o])]);
|
|
1978
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(o,"_yourself",[]),"__eq",[o])]);
|
|
1979
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq",[smalltalk.send(o,"_yourself",[])])]);
|
|
1980
|
+
return self}
|
|
851
1981
|
}),
|
|
852
1982
|
smalltalk.ObjectTest);
|
|
853
1983
|
|
|
@@ -857,8 +1987,10 @@ smalltalk.method({
|
|
|
857
1987
|
selector: "testHalt",
|
|
858
1988
|
fn: function (){
|
|
859
1989
|
var self=this;
|
|
860
|
-
smalltalk.send(self,
|
|
861
|
-
return
|
|
1990
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
1991
|
+
return smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_halt",[]);
|
|
1992
|
+
}),(smalltalk.Error || Error)]);
|
|
1993
|
+
return self}
|
|
862
1994
|
}),
|
|
863
1995
|
smalltalk.ObjectTest);
|
|
864
1996
|
|
|
@@ -868,13 +2000,13 @@ smalltalk.method({
|
|
|
868
2000
|
selector: "testIdentity",
|
|
869
2001
|
fn: function (){
|
|
870
2002
|
var self=this;
|
|
871
|
-
var o
|
|
872
|
-
|
|
873
|
-
smalltalk.send(self,
|
|
874
|
-
smalltalk.send(self,
|
|
875
|
-
smalltalk.send(self,
|
|
876
|
-
smalltalk.send(self,
|
|
877
|
-
return self
|
|
2003
|
+
var o;
|
|
2004
|
+
o=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
2005
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(o,"__eq_eq",[smalltalk.send((smalltalk.Object || Object),"_new",[])])]);
|
|
2006
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq_eq",[o])]);
|
|
2007
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(o,"_yourself",[]),"__eq_eq",[o])]);
|
|
2008
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(o,"__eq_eq",[smalltalk.send(o,"_yourself",[])])]);
|
|
2009
|
+
return self}
|
|
878
2010
|
}),
|
|
879
2011
|
smalltalk.ObjectTest);
|
|
880
2012
|
|
|
@@ -884,12 +2016,35 @@ smalltalk.method({
|
|
|
884
2016
|
selector: "testIfNil",
|
|
885
2017
|
fn: function (){
|
|
886
2018
|
var self=this;
|
|
887
|
-
|
|
888
|
-
smalltalk.send(self,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
2019
|
+
var $2,$1,$4,$3,$6,$5;
|
|
2020
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_isNil",[])]);
|
|
2021
|
+
$2=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
2022
|
+
if(($receiver = $2) == nil || $receiver == undefined){
|
|
2023
|
+
$1=true;
|
|
2024
|
+
} else {
|
|
2025
|
+
$1=$2;
|
|
2026
|
+
};
|
|
2027
|
+
smalltalk.send(self,"_deny_",[smalltalk.send($1,"__eq",[true])]);
|
|
2028
|
+
$4=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
2029
|
+
if(($receiver = $4) == nil || $receiver == undefined){
|
|
2030
|
+
$3=$4;
|
|
2031
|
+
} else {
|
|
2032
|
+
$3=true;
|
|
2033
|
+
};
|
|
2034
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($3,"__eq",[true])]);
|
|
2035
|
+
$6=smalltalk.send((smalltalk.Object || Object),"_new",[]);
|
|
2036
|
+
if(($receiver = $6) == nil || $receiver == undefined){
|
|
2037
|
+
$5=false;
|
|
2038
|
+
} else {
|
|
2039
|
+
$5=true;
|
|
2040
|
+
};
|
|
2041
|
+
smalltalk.send(self,"_assert_",[smalltalk.send($5,"__eq",[true])]);
|
|
2042
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Object || Object),"_new",[]),"_ifNotNil_ifNil_",[(function(){
|
|
2043
|
+
return true;
|
|
2044
|
+
}),(function(){
|
|
2045
|
+
return false;
|
|
2046
|
+
})]),"__eq",[true])]);
|
|
2047
|
+
return self}
|
|
893
2048
|
}),
|
|
894
2049
|
smalltalk.ObjectTest);
|
|
895
2050
|
|
|
@@ -899,13 +2054,13 @@ smalltalk.method({
|
|
|
899
2054
|
selector: "testInstVars",
|
|
900
2055
|
fn: function (){
|
|
901
2056
|
var self=this;
|
|
902
|
-
var o
|
|
903
|
-
|
|
904
|
-
smalltalk.send(self,
|
|
905
|
-
smalltalk.send(o,
|
|
906
|
-
smalltalk.send(self,
|
|
907
|
-
smalltalk.send(self,
|
|
908
|
-
return self
|
|
2057
|
+
var o;
|
|
2058
|
+
o=smalltalk.send((smalltalk.ObjectMock || ObjectMock),"_new",[]);
|
|
2059
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",[smalltalk.symbolFor("foo")]),nil]);
|
|
2060
|
+
smalltalk.send(o,"_instVarAt_put_",[smalltalk.symbolFor("foo"),(1)]);
|
|
2061
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",[smalltalk.symbolFor("foo")]),(1)]);
|
|
2062
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(o,"_instVarAt_",["foo"]),(1)]);
|
|
2063
|
+
return self}
|
|
909
2064
|
}),
|
|
910
2065
|
smalltalk.ObjectTest);
|
|
911
2066
|
|
|
@@ -915,8 +2070,11 @@ smalltalk.method({
|
|
|
915
2070
|
selector: "testNilUndefined",
|
|
916
2071
|
fn: function (){
|
|
917
2072
|
var self=this;
|
|
918
|
-
|
|
919
|
-
|
|
2073
|
+
var notDefined;
|
|
2074
|
+
notDefined = undefined;
|
|
2075
|
+
;
|
|
2076
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(nil,"__eq",[notDefined])]);
|
|
2077
|
+
return self}
|
|
920
2078
|
}),
|
|
921
2079
|
smalltalk.ObjectTest);
|
|
922
2080
|
|
|
@@ -924,12 +2082,13 @@ smalltalk.addMethod(
|
|
|
924
2082
|
"_testYourself",
|
|
925
2083
|
smalltalk.method({
|
|
926
2084
|
selector: "testYourself",
|
|
927
|
-
fn: function (){
|
|
928
|
-
var self=this;
|
|
929
|
-
var o
|
|
930
|
-
|
|
931
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
|
|
932
|
-
return self;
|
|
2085
|
+
fn: function () {
|
|
2086
|
+
var self = this;
|
|
2087
|
+
var o;
|
|
2088
|
+
o = smalltalk.send(smalltalk.ObjectMock || ObjectMock, "_new", []);
|
|
2089
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
|
|
2090
|
+
return self;
|
|
2091
|
+
}
|
|
933
2092
|
}),
|
|
934
2093
|
smalltalk.ObjectTest);
|
|
935
2094
|
|
|
@@ -937,15 +2096,16 @@ smalltalk.addMethod(
|
|
|
937
2096
|
"_testidentityHash",
|
|
938
2097
|
smalltalk.method({
|
|
939
2098
|
selector: "testidentityHash",
|
|
940
|
-
fn: function (){
|
|
941
|
-
var self=this;
|
|
942
|
-
var o1
|
|
943
|
-
var o2
|
|
944
|
-
|
|
945
|
-
|
|
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", [])])]);
|
|
948
|
-
return self;
|
|
2099
|
+
fn: function () {
|
|
2100
|
+
var self = this;
|
|
2101
|
+
var o1;
|
|
2102
|
+
var o2;
|
|
2103
|
+
o1 = smalltalk.send(smalltalk.Object || Object, "_new", []);
|
|
2104
|
+
o2 = smalltalk.send(smalltalk.Object || Object, "_new", []);
|
|
2105
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
|
|
2106
|
+
smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
|
|
2107
|
+
return self;
|
|
2108
|
+
}
|
|
949
2109
|
}),
|
|
950
2110
|
smalltalk.ObjectTest);
|
|
951
2111
|
|
|
@@ -958,12 +2118,18 @@ smalltalk.method({
|
|
|
958
2118
|
selector: "setUp",
|
|
959
2119
|
fn: function (){
|
|
960
2120
|
var self=this;
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
smalltalk.send((smalltalk.Package || Package),
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
2121
|
+
var $1,$2;
|
|
2122
|
+
self["@backUpCommitPathJs"]=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs",[]);
|
|
2123
|
+
self["@backUpCommitPathSt"]=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt",[]);
|
|
2124
|
+
smalltalk.send((smalltalk.Package || Package),"_resetCommitPaths",[]);
|
|
2125
|
+
self["@zorkPackage"]=smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_new",[]),"_name_",["Zork"]);
|
|
2126
|
+
$1=smalltalk.send((smalltalk.Package || Package),"_new",[]);
|
|
2127
|
+
smalltalk.send($1,"_name_",["Grul"]);
|
|
2128
|
+
smalltalk.send($1,"_commitPathJs_",["server/grul/js"]);
|
|
2129
|
+
smalltalk.send($1,"_commitPathSt_",["grul/st"]);
|
|
2130
|
+
$2=smalltalk.send($1,"_yourself",[]);
|
|
2131
|
+
self["@grulPackage"]=$2;
|
|
2132
|
+
return self}
|
|
967
2133
|
}),
|
|
968
2134
|
smalltalk.PackageTest);
|
|
969
2135
|
|
|
@@ -973,8 +2139,10 @@ smalltalk.method({
|
|
|
973
2139
|
selector: "tearDown",
|
|
974
2140
|
fn: function (){
|
|
975
2141
|
var self=this;
|
|
976
|
-
|
|
977
|
-
|
|
2142
|
+
var $1;
|
|
2143
|
+
smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs_",[self["@backUpCommitPathJs"]]);
|
|
2144
|
+
$1=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt_",[self["@backUpCommitPathSt"]]);
|
|
2145
|
+
return self}
|
|
978
2146
|
}),
|
|
979
2147
|
smalltalk.PackageTest);
|
|
980
2148
|
|
|
@@ -984,8 +2152,8 @@ smalltalk.method({
|
|
|
984
2152
|
selector: "testGrulCommitPathJsShouldBeServerGrulJs",
|
|
985
2153
|
fn: function (){
|
|
986
2154
|
var self=this;
|
|
987
|
-
smalltalk.send(self,
|
|
988
|
-
return self
|
|
2155
|
+
smalltalk.send(self,"_assert_equals_",["server/grul/js",smalltalk.send(self["@grulPackage"],"_commitPathJs",[])]);
|
|
2156
|
+
return self}
|
|
989
2157
|
}),
|
|
990
2158
|
smalltalk.PackageTest);
|
|
991
2159
|
|
|
@@ -995,8 +2163,8 @@ smalltalk.method({
|
|
|
995
2163
|
selector: "testGrulCommitPathStShouldBeGrulSt",
|
|
996
2164
|
fn: function (){
|
|
997
2165
|
var self=this;
|
|
998
|
-
smalltalk.send(self,
|
|
999
|
-
return self
|
|
2166
|
+
smalltalk.send(self,"_assert_equals_",["grul/st",smalltalk.send(self["@grulPackage"],"_commitPathSt",[])]);
|
|
2167
|
+
return self}
|
|
1000
2168
|
}),
|
|
1001
2169
|
smalltalk.PackageTest);
|
|
1002
2170
|
|
|
@@ -1006,8 +2174,8 @@ smalltalk.method({
|
|
|
1006
2174
|
selector: "testZorkCommitPathJsShouldBeJs",
|
|
1007
2175
|
fn: function (){
|
|
1008
2176
|
var self=this;
|
|
1009
|
-
smalltalk.send(self,
|
|
1010
|
-
return self
|
|
2177
|
+
smalltalk.send(self,"_assert_equals_",["js",smalltalk.send(self["@zorkPackage"],"_commitPathJs",[])]);
|
|
2178
|
+
return self}
|
|
1011
2179
|
}),
|
|
1012
2180
|
smalltalk.PackageTest);
|
|
1013
2181
|
|
|
@@ -1017,8 +2185,8 @@ smalltalk.method({
|
|
|
1017
2185
|
selector: "testZorkCommitPathStShouldBeSt",
|
|
1018
2186
|
fn: function (){
|
|
1019
2187
|
var self=this;
|
|
1020
|
-
smalltalk.send(self,
|
|
1021
|
-
return self
|
|
2188
|
+
smalltalk.send(self,"_assert_equals_",["st",smalltalk.send(self["@zorkPackage"],"_commitPathSt",[])]);
|
|
2189
|
+
return self}
|
|
1022
2190
|
}),
|
|
1023
2191
|
smalltalk.PackageTest);
|
|
1024
2192
|
|
|
@@ -1031,9 +2199,11 @@ smalltalk.method({
|
|
|
1031
2199
|
selector: "setUp",
|
|
1032
2200
|
fn: function (){
|
|
1033
2201
|
var self=this;
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
2202
|
+
var $1;
|
|
2203
|
+
smalltalk.send(self,"_setUp",[],smalltalk.PackageTest);
|
|
2204
|
+
smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathJs_",["javascripts/"]);
|
|
2205
|
+
$1=smalltalk.send((smalltalk.Package || Package),"_defaultCommitPathSt_",["smalltalk/"]);
|
|
2206
|
+
return self}
|
|
1037
2207
|
}),
|
|
1038
2208
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
|
1039
2209
|
|
|
@@ -1043,8 +2213,8 @@ smalltalk.method({
|
|
|
1043
2213
|
selector: "testGrulCommitPathJsShouldBeServerGrulJs",
|
|
1044
2214
|
fn: function (){
|
|
1045
2215
|
var self=this;
|
|
1046
|
-
smalltalk.send(self,
|
|
1047
|
-
return self
|
|
2216
|
+
smalltalk.send(self,"_assert_equals_",["server/grul/js",smalltalk.send(self["@grulPackage"],"_commitPathJs",[])]);
|
|
2217
|
+
return self}
|
|
1048
2218
|
}),
|
|
1049
2219
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
|
1050
2220
|
|
|
@@ -1054,8 +2224,8 @@ smalltalk.method({
|
|
|
1054
2224
|
selector: "testGrulCommitPathStShouldBeGrulSt",
|
|
1055
2225
|
fn: function (){
|
|
1056
2226
|
var self=this;
|
|
1057
|
-
smalltalk.send(self,
|
|
1058
|
-
return self
|
|
2227
|
+
smalltalk.send(self,"_assert_equals_",["grul/st",smalltalk.send(self["@grulPackage"],"_commitPathSt",[])]);
|
|
2228
|
+
return self}
|
|
1059
2229
|
}),
|
|
1060
2230
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
|
1061
2231
|
|
|
@@ -1065,8 +2235,8 @@ smalltalk.method({
|
|
|
1065
2235
|
selector: "testZorkCommitPathJsShouldBeJavascript",
|
|
1066
2236
|
fn: function (){
|
|
1067
2237
|
var self=this;
|
|
1068
|
-
smalltalk.send(self,
|
|
1069
|
-
return self
|
|
2238
|
+
smalltalk.send(self,"_assert_equals_",["javascripts/",smalltalk.send(self["@zorkPackage"],"_commitPathJs",[])]);
|
|
2239
|
+
return self}
|
|
1070
2240
|
}),
|
|
1071
2241
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
|
1072
2242
|
|
|
@@ -1076,8 +2246,8 @@ smalltalk.method({
|
|
|
1076
2246
|
selector: "testZorkCommitPathStShouldBeSmalltalk",
|
|
1077
2247
|
fn: function (){
|
|
1078
2248
|
var self=this;
|
|
1079
|
-
smalltalk.send(self,
|
|
1080
|
-
return self
|
|
2249
|
+
smalltalk.send(self,"_assert_equals_",["smalltalk/",smalltalk.send(self["@zorkPackage"],"_commitPathSt",[])]);
|
|
2250
|
+
return self}
|
|
1081
2251
|
}),
|
|
1082
2252
|
smalltalk.PackageWithDefaultCommitPathChangedTest);
|
|
1083
2253
|
|
|
@@ -1089,7 +2259,7 @@ selector: "shouldInheritSelectors",
|
|
|
1089
2259
|
fn: function (){
|
|
1090
2260
|
var self=this;
|
|
1091
2261
|
return false;
|
|
1092
|
-
|
|
2262
|
+
}
|
|
1093
2263
|
}),
|
|
1094
2264
|
smalltalk.PackageWithDefaultCommitPathChangedTest.klass);
|
|
1095
2265
|
|
|
@@ -1101,11 +2271,11 @@ smalltalk.method({
|
|
|
1101
2271
|
selector: "testAccessing",
|
|
1102
2272
|
fn: function (){
|
|
1103
2273
|
var self=this;
|
|
1104
|
-
smalltalk.send(self,
|
|
1105
|
-
smalltalk.send(self,
|
|
1106
|
-
smalltalk.send(self,
|
|
1107
|
-
smalltalk.send(self,
|
|
1108
|
-
return self
|
|
2274
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)]),"_x",[]),(3)]);
|
|
2275
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)]),"_y",[]),(4)]);
|
|
2276
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_new",[]),"_x_",[(3)]),"_x",[]),(3)]);
|
|
2277
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point),"_new",[]),"_y_",[(4)]),"_y",[]),(4)]);
|
|
2278
|
+
return self}
|
|
1109
2279
|
}),
|
|
1110
2280
|
smalltalk.PointTest);
|
|
1111
2281
|
|
|
@@ -1115,11 +2285,11 @@ smalltalk.method({
|
|
|
1115
2285
|
selector: "testArithmetic",
|
|
1116
2286
|
fn: function (){
|
|
1117
2287
|
var self=this;
|
|
1118
|
-
smalltalk.send(self,
|
|
1119
|
-
smalltalk.send(self,
|
|
1120
|
-
smalltalk.send(self,
|
|
1121
|
-
smalltalk.send(self,
|
|
1122
|
-
return self
|
|
2288
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__star",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(9),(16)])]);
|
|
2289
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__plus",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(6),(8)])]);
|
|
2290
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__minus",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(0),(0)])]);
|
|
2291
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((6),"__at",[(8)]),"__slash",[smalltalk.send((3),"__at",[(4)])]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(2),(2)])]);
|
|
2292
|
+
return self}
|
|
1123
2293
|
}),
|
|
1124
2294
|
smalltalk.PointTest);
|
|
1125
2295
|
|
|
@@ -1129,8 +2299,8 @@ smalltalk.method({
|
|
|
1129
2299
|
selector: "testAt",
|
|
1130
2300
|
fn: function (){
|
|
1131
2301
|
var self=this;
|
|
1132
|
-
smalltalk.send(self,
|
|
1133
|
-
return self
|
|
2302
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((3),"__at",[(4)]),smalltalk.send((smalltalk.Point || Point),"_x_y_",[(3),(4)])]);
|
|
2303
|
+
return self}
|
|
1134
2304
|
}),
|
|
1135
2305
|
smalltalk.PointTest);
|
|
1136
2306
|
|
|
@@ -1140,9 +2310,9 @@ smalltalk.method({
|
|
|
1140
2310
|
selector: "testEgality",
|
|
1141
2311
|
fn: function (){
|
|
1142
2312
|
var self=this;
|
|
1143
|
-
smalltalk.send(self,
|
|
1144
|
-
smalltalk.send(self,
|
|
1145
|
-
return self
|
|
2313
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send((3),"__at",[(4)]),"__eq",[smalltalk.send((3),"__at",[(4)])])]);
|
|
2314
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send((3),"__at",[(5)]),"__eq",[smalltalk.send((3),"__at",[(6)])])]);
|
|
2315
|
+
return self}
|
|
1146
2316
|
}),
|
|
1147
2317
|
smalltalk.PointTest);
|
|
1148
2318
|
|
|
@@ -1152,11 +2322,11 @@ smalltalk.method({
|
|
|
1152
2322
|
selector: "testTranslateBy",
|
|
1153
2323
|
fn: function (){
|
|
1154
2324
|
var self=this;
|
|
1155
|
-
smalltalk.send(self,
|
|
1156
|
-
smalltalk.send(self,
|
|
1157
|
-
smalltalk.send(self,
|
|
1158
|
-
smalltalk.send(self,
|
|
1159
|
-
return self
|
|
2325
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((3),"__at",[(4)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send((0),"__at",[(1)])])]);
|
|
2326
|
+
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",[])])])]);
|
|
2327
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send((5),"__at",[(6)]),smalltalk.send(smalltalk.send((3),"__at",[(3)]),"_translateBy_",[smalltalk.send((2),"__at",[(3)])])]);
|
|
2328
|
+
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)])])]);
|
|
2329
|
+
return self}
|
|
1160
2330
|
}),
|
|
1161
2331
|
smalltalk.PointTest);
|
|
1162
2332
|
|
|
@@ -1169,10 +2339,17 @@ smalltalk.method({
|
|
|
1169
2339
|
selector: "textNext",
|
|
1170
2340
|
fn: function (){
|
|
1171
2341
|
var self=this;
|
|
1172
|
-
smalltalk.send((10000),
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
|
|
2342
|
+
smalltalk.send((10000),"_timesRepeat_",[(function(){
|
|
2343
|
+
var current;
|
|
2344
|
+
var next;
|
|
2345
|
+
next=smalltalk.send(smalltalk.send((smalltalk.Random || Random),"_new",[]),"_next",[]);
|
|
2346
|
+
next;
|
|
2347
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(next,"__gt_eq",[(0)])]);
|
|
2348
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(next,"__lt",[(1)])]);
|
|
2349
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(current,"__eq",[next])]);
|
|
2350
|
+
return smalltalk.send(next,"__eq",[current]);
|
|
2351
|
+
})]);
|
|
2352
|
+
return self}
|
|
1176
2353
|
}),
|
|
1177
2354
|
smalltalk.RandomTest);
|
|
1178
2355
|
|
|
@@ -1185,16 +2362,16 @@ smalltalk.method({
|
|
|
1185
2362
|
selector: "testAddRemove",
|
|
1186
2363
|
fn: function (){
|
|
1187
2364
|
var self=this;
|
|
1188
|
-
var set
|
|
1189
|
-
|
|
1190
|
-
smalltalk.send(self,
|
|
1191
|
-
smalltalk.send(set,
|
|
1192
|
-
smalltalk.send(self,
|
|
1193
|
-
smalltalk.send(set,
|
|
1194
|
-
smalltalk.send(self,
|
|
1195
|
-
smalltalk.send(set,
|
|
1196
|
-
smalltalk.send(self,
|
|
1197
|
-
return self
|
|
2365
|
+
var set;
|
|
2366
|
+
set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
|
|
2367
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(set,"_isEmpty",[])]);
|
|
2368
|
+
smalltalk.send(set,"_add_",[(3)]);
|
|
2369
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[(3)])]);
|
|
2370
|
+
smalltalk.send(set,"_add_",[(5)]);
|
|
2371
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(set,"_includes_",[(5)])]);
|
|
2372
|
+
smalltalk.send(set,"_remove_",[(3)]);
|
|
2373
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(set,"_includes_",[(3)])]);
|
|
2374
|
+
return self}
|
|
1198
2375
|
}),
|
|
1199
2376
|
smalltalk.SetTest);
|
|
1200
2377
|
|
|
@@ -1204,314 +2381,70 @@ smalltalk.method({
|
|
|
1204
2381
|
selector: "testAt",
|
|
1205
2382
|
fn: function (){
|
|
1206
2383
|
var self=this;
|
|
1207
|
-
smalltalk.send(self,
|
|
1208
|
-
return
|
|
1209
|
-
}),
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
smalltalk.addMethod(
|
|
1213
|
-
"_testSize",
|
|
1214
|
-
smalltalk.method({
|
|
1215
|
-
selector: "testSize",
|
|
1216
|
-
fn: function (){
|
|
1217
|
-
var self=this;
|
|
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)]);
|
|
1221
|
-
return self;}
|
|
2384
|
+
smalltalk.send(self,"_should_raise_",[(function(){
|
|
2385
|
+
return smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_new",[]),"_at_put_",[(1),(2)]);
|
|
2386
|
+
}),(smalltalk.Error || Error)]);
|
|
2387
|
+
return self}
|
|
1222
2388
|
}),
|
|
1223
2389
|
smalltalk.SetTest);
|
|
1224
2390
|
|
|
1225
2391
|
smalltalk.addMethod(
|
|
1226
|
-
"
|
|
2392
|
+
"_testPrintString",
|
|
1227
2393
|
smalltalk.method({
|
|
1228
|
-
selector: "
|
|
2394
|
+
selector: "testPrintString",
|
|
1229
2395
|
fn: function (){
|
|
1230
2396
|
var self=this;
|
|
1231
|
-
var
|
|
1232
|
-
|
|
1233
|
-
smalltalk.send(
|
|
1234
|
-
smalltalk.send(
|
|
1235
|
-
smalltalk.send(set,
|
|
1236
|
-
smalltalk.send(
|
|
1237
|
-
smalltalk.send(
|
|
1238
|
-
smalltalk.send(
|
|
1239
|
-
smalltalk.send(self,
|
|
1240
|
-
|
|
2397
|
+
var $1,$2;
|
|
2398
|
+
var set;
|
|
2399
|
+
set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
|
|
2400
|
+
smalltalk.send(self,"_assert_equals_",["a Set ()",smalltalk.send(set,"_printString",[])]);
|
|
2401
|
+
smalltalk.send(set,"_add_",[(1)]);
|
|
2402
|
+
$1=smalltalk.send(set,"_add_",[(3)]);
|
|
2403
|
+
smalltalk.send(self,"_assert_equals_",["a Set (1 3)",smalltalk.send(set,"_printString",[])]);
|
|
2404
|
+
smalltalk.send(set,"_add_",["foo"]);
|
|
2405
|
+
smalltalk.send(self,"_assert_equals_",["a Set (1 3 'foo')",smalltalk.send(set,"_printString",[])]);
|
|
2406
|
+
smalltalk.send(set,"_remove_",[(1)]);
|
|
2407
|
+
$2=smalltalk.send(set,"_remove_",[(3)]);
|
|
2408
|
+
smalltalk.send(self,"_assert_equals_",["a Set ('foo')",smalltalk.send(set,"_printString",[])]);
|
|
2409
|
+
smalltalk.send(set,"_add_",[(3)]);
|
|
2410
|
+
smalltalk.send(self,"_assert_equals_",["a Set ('foo' 3)",smalltalk.send(set,"_printString",[])]);
|
|
2411
|
+
smalltalk.send(set,"_add_",[(3)]);
|
|
2412
|
+
smalltalk.send(self,"_assert_equals_",["a Set ('foo' 3)",smalltalk.send(set,"_printString",[])]);
|
|
2413
|
+
return self}
|
|
1241
2414
|
}),
|
|
1242
2415
|
smalltalk.SetTest);
|
|
1243
2416
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
smalltalk.addClass('StringTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
1247
|
-
smalltalk.addMethod(
|
|
1248
|
-
"_testAddRemove",
|
|
1249
|
-
smalltalk.method({
|
|
1250
|
-
selector: "testAddRemove",
|
|
1251
|
-
fn: function (){
|
|
1252
|
-
var self=this;
|
|
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)]);
|
|
1255
|
-
return self;}
|
|
1256
|
-
}),
|
|
1257
|
-
smalltalk.StringTest);
|
|
1258
|
-
|
|
1259
|
-
smalltalk.addMethod(
|
|
1260
|
-
"_testAsArray",
|
|
1261
|
-
smalltalk.method({
|
|
1262
|
-
selector: "testAsArray",
|
|
1263
|
-
fn: function (){
|
|
1264
|
-
var self=this;
|
|
1265
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send("hello", "_asArray", []), "__eq", [["h", "e", "l", "l", "o"]])]);
|
|
1266
|
-
return self;}
|
|
1267
|
-
}),
|
|
1268
|
-
smalltalk.StringTest);
|
|
1269
|
-
|
|
1270
|
-
smalltalk.addMethod(
|
|
1271
|
-
"_testAt",
|
|
1272
|
-
smalltalk.method({
|
|
1273
|
-
selector: "testAt",
|
|
1274
|
-
fn: function (){
|
|
1275
|
-
var self=this;
|
|
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])]);
|
|
1279
|
-
return self;}
|
|
1280
|
-
}),
|
|
1281
|
-
smalltalk.StringTest);
|
|
1282
|
-
|
|
1283
|
-
smalltalk.addMethod(
|
|
1284
|
-
"_testAtPut",
|
|
1285
|
-
smalltalk.method({
|
|
1286
|
-
selector: "testAtPut",
|
|
1287
|
-
fn: function (){
|
|
1288
|
-
var self=this;
|
|
1289
|
-
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
|
|
1290
|
-
return self;}
|
|
1291
|
-
}),
|
|
1292
|
-
smalltalk.StringTest);
|
|
1293
|
-
|
|
1294
|
-
smalltalk.addMethod(
|
|
1295
|
-
"_testCopyWithoutAll",
|
|
1296
|
-
smalltalk.method({
|
|
1297
|
-
selector: "testCopyWithoutAll",
|
|
1298
|
-
fn: function (){
|
|
1299
|
-
var self=this;
|
|
1300
|
-
smalltalk.send(self, "_assert_equals_", ["hello world", smalltalk.send("*hello* *world*", "_copyWithoutAll_", ["*"])]);
|
|
1301
|
-
return self;}
|
|
1302
|
-
}),
|
|
1303
|
-
smalltalk.StringTest);
|
|
1304
|
-
|
|
1305
|
-
smalltalk.addMethod(
|
|
1306
|
-
"_testEquality",
|
|
1307
|
-
smalltalk.method({
|
|
1308
|
-
selector: "testEquality",
|
|
1309
|
-
fn: function (){
|
|
1310
|
-
var self=this;
|
|
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)])]);
|
|
1316
|
-
return self;}
|
|
1317
|
-
}),
|
|
1318
|
-
smalltalk.StringTest);
|
|
1319
|
-
|
|
1320
|
-
smalltalk.addMethod(
|
|
1321
|
-
"_testIdentity",
|
|
1322
|
-
smalltalk.method({
|
|
1323
|
-
selector: "testIdentity",
|
|
1324
|
-
fn: function (){
|
|
1325
|
-
var self=this;
|
|
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)])]);
|
|
1331
|
-
return self;}
|
|
1332
|
-
}),
|
|
1333
|
-
smalltalk.StringTest);
|
|
1334
|
-
|
|
1335
|
-
smalltalk.addMethod(
|
|
1336
|
-
"_testIncludesSubString",
|
|
1337
|
-
smalltalk.method({
|
|
1338
|
-
selector: "testIncludesSubString",
|
|
1339
|
-
fn: function (){
|
|
1340
|
-
var self=this;
|
|
1341
|
-
smalltalk.send(self, "_assert_", [smalltalk.send("amber", "_includesSubString_", ["ber"])]);
|
|
1342
|
-
smalltalk.send(self, "_deny_", [smalltalk.send("amber", "_includesSubString_", ["zork"])]);
|
|
1343
|
-
return self;}
|
|
1344
|
-
}),
|
|
1345
|
-
smalltalk.StringTest);
|
|
1346
|
-
|
|
1347
|
-
smalltalk.addMethod(
|
|
1348
|
-
"_testJoin",
|
|
1349
|
-
smalltalk.method({
|
|
1350
|
-
selector: "testJoin",
|
|
1351
|
-
fn: function (){
|
|
1352
|
-
var self=this;
|
|
1353
|
-
smalltalk.send(self, "_assert_equals_", ["hello,world", smalltalk.send(",", "_join_", [["hello", "world"]])]);
|
|
1354
|
-
return self;}
|
|
1355
|
-
}),
|
|
1356
|
-
smalltalk.StringTest);
|
|
1357
|
-
|
|
1358
2417
|
smalltalk.addMethod(
|
|
1359
2418
|
"_testSize",
|
|
1360
2419
|
smalltalk.method({
|
|
1361
2420
|
selector: "testSize",
|
|
1362
2421
|
fn: function (){
|
|
1363
2422
|
var self=this;
|
|
1364
|
-
smalltalk.send(self,
|
|
1365
|
-
smalltalk.send(self,
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
smalltalk.StringTest);
|
|
1369
|
-
|
|
1370
|
-
smalltalk.addMethod(
|
|
1371
|
-
"_testStreamContents",
|
|
1372
|
-
smalltalk.method({
|
|
1373
|
-
selector: "testStreamContents",
|
|
1374
|
-
fn: function (){
|
|
1375
|
-
var self=this;
|
|
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);})])]);
|
|
1377
|
-
return self;}
|
|
1378
|
-
}),
|
|
1379
|
-
smalltalk.StringTest);
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
|
|
1384
|
-
smalltalk.addMethod(
|
|
1385
|
-
"_testAsString",
|
|
1386
|
-
smalltalk.method({
|
|
1387
|
-
selector: "testAsString",
|
|
1388
|
-
fn: function (){
|
|
1389
|
-
var self=this;
|
|
1390
|
-
smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
|
|
1391
|
-
return self;}
|
|
1392
|
-
}),
|
|
1393
|
-
smalltalk.SymbolTest);
|
|
1394
|
-
|
|
1395
|
-
smalltalk.addMethod(
|
|
1396
|
-
"_testAsSymbol",
|
|
1397
|
-
smalltalk.method({
|
|
1398
|
-
selector: "testAsSymbol",
|
|
1399
|
-
fn: function (){
|
|
1400
|
-
var self=this;
|
|
1401
|
-
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
|
|
1402
|
-
return self;}
|
|
1403
|
-
}),
|
|
1404
|
-
smalltalk.SymbolTest);
|
|
1405
|
-
|
|
1406
|
-
smalltalk.addMethod(
|
|
1407
|
-
"_testAt",
|
|
1408
|
-
smalltalk.method({
|
|
1409
|
-
selector: "testAt",
|
|
1410
|
-
fn: function (){
|
|
1411
|
-
var self=this;
|
|
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])]);
|
|
1415
|
-
return self;}
|
|
1416
|
-
}),
|
|
1417
|
-
smalltalk.SymbolTest);
|
|
1418
|
-
|
|
1419
|
-
smalltalk.addMethod(
|
|
1420
|
-
"_testAtPut",
|
|
1421
|
-
smalltalk.method({
|
|
1422
|
-
selector: "testAtPut",
|
|
1423
|
-
fn: function (){
|
|
1424
|
-
var self=this;
|
|
1425
|
-
smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
|
|
1426
|
-
return self;}
|
|
1427
|
-
}),
|
|
1428
|
-
smalltalk.SymbolTest);
|
|
1429
|
-
|
|
1430
|
-
smalltalk.addMethod(
|
|
1431
|
-
"_testComparing",
|
|
1432
|
-
smalltalk.method({
|
|
1433
|
-
selector: "testComparing",
|
|
1434
|
-
fn: function (){
|
|
1435
|
-
var self=this;
|
|
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")]))]);
|
|
1444
|
-
return self;}
|
|
1445
|
-
}),
|
|
1446
|
-
smalltalk.SymbolTest);
|
|
1447
|
-
|
|
1448
|
-
smalltalk.addMethod(
|
|
1449
|
-
"_testCopying",
|
|
1450
|
-
smalltalk.method({
|
|
1451
|
-
selector: "testCopying",
|
|
1452
|
-
fn: function (){
|
|
1453
|
-
var self=this;
|
|
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")])]);
|
|
1456
|
-
return self;}
|
|
1457
|
-
}),
|
|
1458
|
-
smalltalk.SymbolTest);
|
|
1459
|
-
|
|
1460
|
-
smalltalk.addMethod(
|
|
1461
|
-
"_testEquality",
|
|
1462
|
-
smalltalk.method({
|
|
1463
|
-
selector: "testEquality",
|
|
1464
|
-
fn: function (){
|
|
1465
|
-
var self=this;
|
|
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")])]);
|
|
1472
|
-
return self;}
|
|
1473
|
-
}),
|
|
1474
|
-
smalltalk.SymbolTest);
|
|
1475
|
-
|
|
1476
|
-
smalltalk.addMethod(
|
|
1477
|
-
"_testIdentity",
|
|
1478
|
-
smalltalk.method({
|
|
1479
|
-
selector: "testIdentity",
|
|
1480
|
-
fn: function (){
|
|
1481
|
-
var self=this;
|
|
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", [])])]);
|
|
1486
|
-
return self;}
|
|
1487
|
-
}),
|
|
1488
|
-
smalltalk.SymbolTest);
|
|
1489
|
-
|
|
1490
|
-
smalltalk.addMethod(
|
|
1491
|
-
"_testIsSymbolIsString",
|
|
1492
|
-
smalltalk.method({
|
|
1493
|
-
selector: "testIsSymbolIsString",
|
|
1494
|
-
fn: function (){
|
|
1495
|
-
var self=this;
|
|
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", [])]);
|
|
1500
|
-
return self;}
|
|
2423
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_new",[]),"_size",[]),(0)]);
|
|
2424
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_withAll_",[[(1), (2), (3), (4)]]),"_size",[]),(4)]);
|
|
2425
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(smalltalk.send((smalltalk.Set || Set),"_withAll_",[[(1), (1), (1), (1)]]),"_size",[]),(1)]);
|
|
2426
|
+
return self}
|
|
1501
2427
|
}),
|
|
1502
|
-
smalltalk.
|
|
2428
|
+
smalltalk.SetTest);
|
|
1503
2429
|
|
|
1504
2430
|
smalltalk.addMethod(
|
|
1505
|
-
"
|
|
2431
|
+
"_testUnicity",
|
|
1506
2432
|
smalltalk.method({
|
|
1507
|
-
selector: "
|
|
2433
|
+
selector: "testUnicity",
|
|
1508
2434
|
fn: function (){
|
|
1509
2435
|
var self=this;
|
|
1510
|
-
|
|
1511
|
-
smalltalk.send(
|
|
1512
|
-
|
|
2436
|
+
var set;
|
|
2437
|
+
set=smalltalk.send((smalltalk.Set || Set),"_new",[]);
|
|
2438
|
+
smalltalk.send(set,"_add_",[(21)]);
|
|
2439
|
+
smalltalk.send(set,"_add_",["hello"]);
|
|
2440
|
+
smalltalk.send(set,"_add_",[(21)]);
|
|
2441
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(2)])]);
|
|
2442
|
+
smalltalk.send(set,"_add_",["hello"]);
|
|
2443
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(set,"_size",[]),"__eq",[(2)])]);
|
|
2444
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(set,"_asArray",[]),[(21), "hello"]]);
|
|
2445
|
+
return self}
|
|
1513
2446
|
}),
|
|
1514
|
-
smalltalk.
|
|
2447
|
+
smalltalk.SetTest);
|
|
1515
2448
|
|
|
1516
2449
|
|
|
1517
2450
|
|
|
@@ -1522,8 +2455,8 @@ smalltalk.method({
|
|
|
1522
2455
|
selector: "testCopying",
|
|
1523
2456
|
fn: function (){
|
|
1524
2457
|
var self=this;
|
|
1525
|
-
smalltalk.send(self,
|
|
1526
|
-
return self
|
|
2458
|
+
smalltalk.send(self,"_assert_equals_",[smalltalk.send(nil,"_copy",[]),nil]);
|
|
2459
|
+
return self}
|
|
1527
2460
|
}),
|
|
1528
2461
|
smalltalk.UndefinedTest);
|
|
1529
2462
|
|
|
@@ -1533,8 +2466,8 @@ smalltalk.method({
|
|
|
1533
2466
|
selector: "testDeepCopy",
|
|
1534
2467
|
fn: function (){
|
|
1535
2468
|
var self=this;
|
|
1536
|
-
smalltalk.send(self,
|
|
1537
|
-
return self
|
|
2469
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(smalltalk.send(nil,"_deepCopy",[]),"__eq",[nil])]);
|
|
2470
|
+
return self}
|
|
1538
2471
|
}),
|
|
1539
2472
|
smalltalk.UndefinedTest);
|
|
1540
2473
|
|
|
@@ -1544,11 +2477,31 @@ smalltalk.method({
|
|
|
1544
2477
|
selector: "testIfNil",
|
|
1545
2478
|
fn: function (){
|
|
1546
2479
|
var self=this;
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
2480
|
+
var $1,$2,$3;
|
|
2481
|
+
if(($receiver = nil) == nil || $receiver == undefined){
|
|
2482
|
+
$1=true;
|
|
2483
|
+
} else {
|
|
2484
|
+
$1=nil;
|
|
2485
|
+
};
|
|
2486
|
+
smalltalk.send(self,"_assert_equals_",[$1,true]);
|
|
2487
|
+
if(($receiver = nil) == nil || $receiver == undefined){
|
|
2488
|
+
$2=nil;
|
|
2489
|
+
} else {
|
|
2490
|
+
$2=true;
|
|
2491
|
+
};
|
|
2492
|
+
smalltalk.send(self,"_deny_",[smalltalk.send($2,"__eq",[true])]);
|
|
2493
|
+
if(($receiver = nil) == nil || $receiver == undefined){
|
|
2494
|
+
$3=true;
|
|
2495
|
+
} else {
|
|
2496
|
+
$3=false;
|
|
2497
|
+
};
|
|
2498
|
+
smalltalk.send(self,"_assert_equals_",[$3,true]);
|
|
2499
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(smalltalk.send(nil,"_ifNotNil_ifNil_",[(function(){
|
|
2500
|
+
return true;
|
|
2501
|
+
}),(function(){
|
|
2502
|
+
return false;
|
|
2503
|
+
})]),"__eq",[true])]);
|
|
2504
|
+
return self}
|
|
1552
2505
|
}),
|
|
1553
2506
|
smalltalk.UndefinedTest);
|
|
1554
2507
|
|
|
@@ -1558,9 +2511,9 @@ smalltalk.method({
|
|
|
1558
2511
|
selector: "testIsNil",
|
|
1559
2512
|
fn: function (){
|
|
1560
2513
|
var self=this;
|
|
1561
|
-
smalltalk.send(self,
|
|
1562
|
-
smalltalk.send(self,
|
|
1563
|
-
return self
|
|
2514
|
+
smalltalk.send(self,"_assert_",[smalltalk.send(nil,"_isNil",[])]);
|
|
2515
|
+
smalltalk.send(self,"_deny_",[smalltalk.send(nil,"_notNil",[])]);
|
|
2516
|
+
return self}
|
|
1564
2517
|
}),
|
|
1565
2518
|
smalltalk.UndefinedTest);
|
|
1566
2519
|
|