Browse Source

- More unit tests
- BlockClosure>>newValue:* methods to call a JS function as a constructor

Nicolas Petton 12 years ago
parent
commit
fbc18e12d8

+ 19 - 17
js/Kernel-Collections.deploy.js

@@ -1109,7 +1109,7 @@ smalltalk.method({
 selector: '>',
 fn: function (aString){
 var self=this;
-return String(self) > aString;
+return String(self) > aString._asString();
 return self;}
 }),
 smalltalk.String);
@@ -1120,7 +1120,7 @@ smalltalk.method({
 selector: '<',
 fn: function (aString){
 var self=this;
-return String(self) < aString;
+return String(self) < aString._asString();
 return self;}
 }),
 smalltalk.String);
@@ -1131,7 +1131,7 @@ smalltalk.method({
 selector: '>=',
 fn: function (aString){
 var self=this;
-return String(self) >= aString;
+return String(self) >= aString._asString();
 return self;}
 }),
 smalltalk.String);
@@ -1142,7 +1142,7 @@ smalltalk.method({
 selector: '<=',
 fn: function (aString){
 var self=this;
-return String(self) <= aString;
+return String(self) <= aString._asString();
 return self;}
 }),
 smalltalk.String);
@@ -1558,17 +1558,6 @@ return self;}
 }),
 smalltalk.Symbol);
 
-smalltalk.addMethod(
-'_shadowCopy',
-smalltalk.method({
-selector: 'shadowCopy',
-fn: function (){
-var self=this;
-return self;
-return self;}
-}),
-smalltalk.Symbol);
-
 smalltalk.addMethod(
 '__lt',
 smalltalk.method({
@@ -1608,8 +1597,10 @@ smalltalk.method({
 selector: '=',
 fn: function (aSymbol){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])]);
-return self;}
+try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])])}})})();
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
 }),
 smalltalk.Symbol);
 
@@ -1646,6 +1637,17 @@ return self;}
 }),
 smalltalk.Symbol);
 
+smalltalk.addMethod(
+'_shallowCopy',
+smalltalk.method({
+selector: 'shallowCopy',
+fn: function (){
+var self=this;
+return self;
+return self;}
+}),
+smalltalk.Symbol);
+
 
 smalltalk.addMethod(
 '_lookup_',

+ 30 - 28
js/Kernel-Collections.js

@@ -1575,10 +1575,10 @@ selector: unescape('%3E'),
 category: 'comparing',
 fn: function (aString){
 var self=this;
-return String(self) > aString;
+return String(self) > aString._asString();
 return self;},
 args: ["aString"],
-source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString%3E'),
+source: unescape('%3E%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%20aString._asString%28%29%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1591,10 +1591,10 @@ selector: unescape('%3C'),
 category: 'comparing',
 fn: function (aString){
 var self=this;
-return String(self) < aString;
+return String(self) < aString._asString();
 return self;},
 args: ["aString"],
-source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString%3E'),
+source: unescape('%3C%20aString%0A%09%3Creturn%20String%28self%29%20%3C%20aString._asString%28%29%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1607,10 +1607,10 @@ selector: unescape('%3E%3D'),
 category: 'comparing',
 fn: function (aString){
 var self=this;
-return String(self) >= aString;
+return String(self) >= aString._asString();
 return self;},
 args: ["aString"],
-source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString%3E'),
+source: unescape('%3E%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3E%3E%3D%20aString._asString%28%29%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1623,10 +1623,10 @@ selector: unescape('%3C%3D'),
 category: 'comparing',
 fn: function (aString){
 var self=this;
-return String(self) <= aString;
+return String(self) <= aString._asString();
 return self;},
 args: ["aString"],
-source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString%3E'),
+source: unescape('%3C%3D%20aString%0A%09%3Creturn%20String%28self%29%20%3C%3D%20aString._asString%28%29%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2218,22 +2218,6 @@ referencedClasses: []
 }),
 smalltalk.Symbol);
 
-smalltalk.addMethod(
-unescape('_shadowCopy'),
-smalltalk.method({
-selector: unescape('shadowCopy'),
-category: 'copying',
-fn: function (){
-var self=this;
-return self;
-return self;},
-args: [],
-source: unescape('shadowCopy%0A%09%5Eself'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Symbol);
-
 smalltalk.addMethod(
 unescape('__lt'),
 smalltalk.method({
@@ -2289,11 +2273,13 @@ selector: unescape('%3D'),
 category: 'comparing',
 fn: function (aSymbol){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])]);
-return self;},
+try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
+(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])])}})})();
+return self;
+} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
 args: ["aSymbol"],
-source: unescape('%3D%20aSymbol%0A%09%5Eself%20asString%20%3D%20aSymbol%20asString'),
-messageSends: [unescape("%3D"), "asString"],
+source: unescape('%3D%20aSymbol%0A%09aSymbol%20class%20%3D%20self%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09%5Eself%20asString%20%3D%20aSymbol%20asString'),
+messageSends: ["ifFalse:", unescape("%3D"), "class", "asString"],
 referencedClasses: []
 }),
 smalltalk.Symbol);
@@ -2346,6 +2332,22 @@ referencedClasses: []
 }),
 smalltalk.Symbol);
 
+smalltalk.addMethod(
+unescape('_shallowCopy'),
+smalltalk.method({
+selector: unescape('shallowCopy'),
+category: 'copying',
+fn: function (){
+var self=this;
+return self;
+return self;},
+args: [],
+source: unescape('shallowCopy%0A%09%5Eself'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Symbol);
+
 
 smalltalk.addMethod(
 unescape('_lookup_'),

+ 33 - 0
js/Kernel-Methods.deploy.js

@@ -335,6 +335,39 @@ return self;}
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+'_newValue_',
+smalltalk.method({
+selector: 'newValue:',
+fn: function (anObject){
+var self=this;
+return new self(anObject);
+return self;}
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_newValue_value_',
+smalltalk.method({
+selector: 'newValue:value:',
+fn: function (anObject, anObject2){
+var self=this;
+return new self(anObject, anObject2);
+return self;}
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_newValue_value_value_',
+smalltalk.method({
+selector: 'newValue:value:value:',
+fn: function (anObject, anObject2, anObject3){
+var self=this;
+return new self(anObject, anObject2);
+return self;}
+}),
+smalltalk.BlockClosure);
+
 
 
 smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');

+ 48 - 0
js/Kernel-Methods.js

@@ -486,6 +486,54 @@ referencedClasses: ["Error"]
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+unescape('_newValue_'),
+smalltalk.method({
+selector: unescape('newValue%3A'),
+category: 'evaluating',
+fn: function (anObject){
+var self=this;
+return new self(anObject);
+return self;},
+args: ["anObject"],
+source: unescape('newValue%3A%20anObject%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+unescape('_newValue_value_'),
+smalltalk.method({
+selector: unescape('newValue%3Avalue%3A'),
+category: 'evaluating',
+fn: function (anObject, anObject2){
+var self=this;
+return new self(anObject, anObject2);
+return self;},
+args: ["anObject", "anObject2"],
+source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+unescape('_newValue_value_value_'),
+smalltalk.method({
+selector: unescape('newValue%3Avalue%3Avalue%3A'),
+category: 'evaluating',
+fn: function (anObject, anObject2, anObject3){
+var self=this;
+return new self(anObject, anObject2);
+return self;},
+args: ["anObject", "anObject2", "anObject3"],
+source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%20value%3A%20anObject3%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
 
 
 smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');

+ 8 - 4
js/Kernel-Objects.deploy.js

@@ -185,9 +185,11 @@ smalltalk.addMethod(
 '_instVarAt_',
 smalltalk.method({
 selector: 'instVarAt:',
-fn: function (aString){
+fn: function (aSymbol){
 var self=this;
-return self['@'+aString];
+var varname=nil;
+varname=smalltalk.send(aSymbol, "_asString", []);
+return self['@'+varname];
 return self;}
 }),
 smalltalk.Object);
@@ -196,9 +198,11 @@ smalltalk.addMethod(
 '_instVarAt_put_',
 smalltalk.method({
 selector: 'instVarAt:put:',
-fn: function (aString, anObject){
+fn: function (aSymbol, anObject){
 var self=this;
-self['@' + aString] = anObject;
+var varname=nil;
+varname=smalltalk.send(aSymbol, "_asString", []);
+self['@' + varname] = anObject;
 return self;}
 }),
 smalltalk.Object);

+ 14 - 10
js/Kernel-Objects.js

@@ -261,13 +261,15 @@ unescape('_instVarAt_'),
 smalltalk.method({
 selector: unescape('instVarAt%3A'),
 category: 'accessing',
-fn: function (aString){
+fn: function (aSymbol){
 var self=this;
-return self['@'+aString];
+var varname=nil;
+varname=smalltalk.send(aSymbol, "_asString", []);
+return self['@'+varname];
 return self;},
-args: ["aString"],
-source: unescape('instVarAt%3A%20aString%0A%09%3Creturn%20self%5B%27@%27+aString%5D%3E'),
-messageSends: [],
+args: ["aSymbol"],
+source: unescape('instVarAt%3A%20aSymbol%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@%27+varname%5D%3E'),
+messageSends: ["asString"],
 referencedClasses: []
 }),
 smalltalk.Object);
@@ -277,13 +279,15 @@ unescape('_instVarAt_put_'),
 smalltalk.method({
 selector: unescape('instVarAt%3Aput%3A'),
 category: 'accessing',
-fn: function (aString, anObject){
+fn: function (aSymbol, anObject){
 var self=this;
-self['@' + aString] = anObject;
+var varname=nil;
+varname=smalltalk.send(aSymbol, "_asString", []);
+self['@' + varname] = anObject;
 return self;},
-args: ["aString", "anObject"],
-source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%3Cself%5B%27@%27%20+%20aString%5D%20%3D%20anObject%3E'),
-messageSends: [],
+args: ["aSymbol", "anObject"],
+source: unescape('instVarAt%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20varname%20%7C%0A%09varname%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@%27%20+%20varname%5D%20%3D%20anObject%3E'),
+messageSends: ["asString"],
 referencedClasses: []
 }),
 smalltalk.Object);

+ 592 - 0
js/Kernel-Tests.deploy.js

@@ -84,6 +84,30 @@ return self;}
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+'_testSize',
+smalltalk.method({
+selector: 'testSize',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
+return self;}
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+'_testAddRemove',
+smalltalk.method({
+selector: 'testAddRemove',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
+return self;}
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -538,6 +562,52 @@ return self;}
 }),
 smalltalk.JSObjectProxyTest);
 
+smalltalk.addMethod(
+'_jsObject',
+smalltalk.method({
+selector: 'jsObject',
+fn: function (){
+var self=this;
+return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+'_testDNU',
+smalltalk.method({
+selector: 'testDNU',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+'_testMessageSend',
+smalltalk.method({
+selector: 'testMessageSend',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+'_testPrinting',
+smalltalk.method({
+selector: 'testPrinting',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", [unescape("%5Bobject%20Object%5D")])]);
+return self;}
+}),
+smalltalk.JSObjectProxyTest);
+
 
 
 smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
@@ -823,5 +893,527 @@ return self;}
 }),
 smalltalk.ObjectTest);
 
+smalltalk.addMethod(
+'_testHalt',
+smalltalk.method({
+selector: 'testHalt',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testBasicAccess',
+smalltalk.method({
+selector: 'testBasicAccess',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testNilUndefined',
+smalltalk.method({
+selector: 'testNilUndefined',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testidentityHash',
+smalltalk.method({
+selector: 'testidentityHash',
+fn: function (){
+var self=this;
+var o1=nil;
+var o2=nil;
+o1=smalltalk.send((smalltalk.Object || Object), "_new", []);
+o2=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testBasicPerform',
+smalltalk.method({
+selector: 'testBasicPerform',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
+smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testIfNil',
+smalltalk.method({
+selector: 'testIfNil',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testInstVars',
+smalltalk.method({
+selector: 'testInstVars',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
+smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testYourself',
+smalltalk.method({
+selector: 'testYourself',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+'_testDNU',
+smalltalk.method({
+selector: 'testDNU',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
+return self;}
+}),
+smalltalk.ObjectTest);
+
+
+
+smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testEquality',
+smalltalk.method({
+selector: 'testEquality',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testAt',
+smalltalk.method({
+selector: 'testAt',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testAtPut',
+smalltalk.method({
+selector: 'testAtPut',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testIdentity',
+smalltalk.method({
+selector: 'testIdentity',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testComparing',
+smalltalk.method({
+selector: 'testComparing',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testSize',
+smalltalk.method({
+selector: 'testSize',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testAsString',
+smalltalk.method({
+selector: 'testAsString',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testAsSymbol',
+smalltalk.method({
+selector: 'testAsSymbol',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testCopying',
+smalltalk.method({
+selector: 'testCopying',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+'_testIsSymbolIsString',
+smalltalk.method({
+selector: 'testIsSymbolIsString',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
+return self;}
+}),
+smalltalk.SymbolTest);
+
+
+
+smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
+smalltalk.addMethod(
+'_foo',
+smalltalk.method({
+selector: 'foo',
+fn: function (){
+var self=this;
+return self['@foo'];
+return self;}
+}),
+smalltalk.ObjectMock);
+
+smalltalk.addMethod(
+'_foo_',
+smalltalk.method({
+selector: 'foo:',
+fn: function (anObject){
+var self=this;
+self['@foo']=anObject;
+return self;}
+}),
+smalltalk.ObjectMock);
+
+
+
+smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testIsNil',
+smalltalk.method({
+selector: 'testIsNil',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
+return self;}
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+'_testIfNil',
+smalltalk.method({
+selector: 'testIfNil',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
+smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+return self;}
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+'_testCopying',
+smalltalk.method({
+selector: 'testCopying',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
+return self;}
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+'_testDeepCopy',
+smalltalk.method({
+selector: 'testDeepCopy',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
+return self;}
+}),
+smalltalk.UndefinedTest);
+
+
+
+smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testAccessing',
+smalltalk.method({
+selector: 'testAccessing',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
+return self;}
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+'_testAt',
+smalltalk.method({
+selector: 'testAt',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
+return self;}
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+'_testEgality',
+smalltalk.method({
+selector: 'testEgality',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
+return self;}
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+'_testArithmetic',
+smalltalk.method({
+selector: 'testArithmetic',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__star", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(9), (16)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver +smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(6), (8)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver -smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__minus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(0), (0)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((6), "__at", [(8)])).klass === smalltalk.Number) ? $receiver /smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__slash", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(2), (2)])]);
+return self;}
+}),
+smalltalk.PointTest);
+
+
+
+smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_textNext',
+smalltalk.method({
+selector: 'textNext',
+fn: function (){
+var self=this;
+smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
+var next=nil;
+next=smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", []);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver >=(0) : smalltalk.send($receiver, "__gt_eq", [(0)]))]);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver <(1) : smalltalk.send($receiver, "__lt", [(1)]))]);smalltalk.send(self, "_deny_", [smalltalk.send(current, "__eq", [next])]);return smalltalk.send(next, "__eq", [current]);})]);
+return self;}
+}),
+smalltalk.RandomTest);
+
+
+
+smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
+smalltalk.addMethod(
+'_setUp',
+smalltalk.method({
+selector: 'setUp',
+fn: function (){
+var self=this;
+self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []);
+return self;}
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+'_tearDown',
+smalltalk.method({
+selector: 'tearDown',
+fn: function (){
+var self=this;
+(($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return self['@theClass']=nil;})() : nil;
+return self;}
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+'_testClassCopy',
+smalltalk.method({
+selector: 'testClassCopy',
+fn: function (){
+var self=this;
+self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
+return self;}
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+'_testInstanceVariableNames',
+smalltalk.method({
+selector: 'testInstanceVariableNames',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", ["  hello   world   "]), ["hello", "world"]]);
+return self;}
+}),
+smalltalk.ClassBuilderTest);
+
+
+
+smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+'_testUnicity',
+smalltalk.method({
+selector: 'testUnicity',
+fn: function (){
+var self=this;
+var set=nil;
+set=smalltalk.send((smalltalk.Set || Set), "_new", []);
+smalltalk.send(set, "_add_", [(21)]);
+smalltalk.send(set, "_add_", ["hello"]);
+smalltalk.send(set, "_add_", [(21)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
+smalltalk.send(set, "_add_", ["hello"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
+return self;}
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+'_testAt',
+smalltalk.method({
+selector: 'testAt',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
+return self;}
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+'_testAddRemove',
+smalltalk.method({
+selector: 'testAddRemove',
+fn: function (){
+var self=this;
+var set=nil;
+set=smalltalk.send((smalltalk.Set || Set), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
+smalltalk.send(set, "_add_", [(3)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
+smalltalk.send(set, "_add_", [(5)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
+smalltalk.send(set, "_remove_", [(3)]);
+smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
+return self;}
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+'_testSize',
+smalltalk.method({
+selector: 'testSize',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
+return self;}
+}),
+smalltalk.SetTest);
+
 
 

+ 812 - 0
js/Kernel-Tests.js

@@ -119,6 +119,40 @@ referencedClasses: ["Error"]
 }),
 smalltalk.StringTest);
 
+smalltalk.addMethod(
+unescape('_testSize'),
+smalltalk.method({
+selector: unescape('testSize'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send("smalltalk", "_size", []), (9)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send("", "_size", []), (0)]);
+return self;},
+args: [],
+source: unescape('testSize%0A%09self%20assert%3A%20%27smalltalk%27%20size%20equals%3A%209.%0A%09self%20assert%3A%20%27%27%20size%20equals%3A%200'),
+messageSends: ["assert:equals:", "size"],
+referencedClasses: []
+}),
+smalltalk.StringTest);
+
+smalltalk.addMethod(
+unescape('_testAddRemove'),
+smalltalk.method({
+selector: unescape('testAddRemove'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_add_", ["a"]);}), (smalltalk.Error || Error)]);
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_remove_", ["h"]);}), (smalltalk.Error || Error)]);
+return self;},
+args: [],
+source: unescape('testAddRemove%0A%09self%20should%3A%20%5B%27hello%27%20add%3A%20%27a%27%5D%20raise%3A%20Error.%0A%09self%20should%3A%20%5B%27hello%27%20remove%3A%20%27h%27%5D%20raise%3A%20Error'),
+messageSends: ["should:raise:", "add:", "remove:"],
+referencedClasses: ["Error"]
+}),
+smalltalk.StringTest);
+
 
 
 smalltalk.addClass('DictionaryTest', smalltalk.TestCase, [], 'Kernel-Tests');
@@ -718,6 +752,72 @@ referencedClasses: []
 }),
 smalltalk.JSObjectProxyTest);
 
+smalltalk.addMethod(
+unescape('_jsObject'),
+smalltalk.method({
+selector: unescape('jsObject'),
+category: 'accessing',
+fn: function (){
+var self=this;
+return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}};
+return self;},
+args: [],
+source: unescape('jsObject%0A%09%3Creturn%20jsObject%20%3D%20%7Ba%3A%201%2C%20b%3A%20function%28%29%20%7Breturn%202%3B%7D%2C%20c%3A%20function%28object%29%20%7Breturn%20object%3B%7D%7D%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+unescape('_testDNU'),
+smalltalk.method({
+selector: unescape('testDNU'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
+return self;},
+args: [],
+source: unescape('testDNU%0A%09self%20should%3A%20%5Bself%20jsObject%20foo%5D%20raise%3A%20MessageNotUnderstood'),
+messageSends: ["should:raise:", "foo", "jsObject"],
+referencedClasses: ["MessageNotUnderstood"]
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+unescape('_testMessageSend'),
+smalltalk.method({
+selector: unescape('testMessageSend'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_a", []), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_b", []), (2)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self, "_jsObject", []), "_c_", [(3)]), (3)]);
+return self;},
+args: [],
+source: unescape('testMessageSend%0A%0A%09self%20assert%3A%20self%20jsObject%20a%20equals%3A%201.%0A%09self%20assert%3A%20self%20jsObject%20b%20equals%3A%202.%0A%09self%20assert%3A%20%28self%20jsObject%20c%3A%203%29%20equals%3A%203'),
+messageSends: ["assert:equals:", "a", "jsObject", "b", "c:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
+smalltalk.addMethod(
+unescape('_testPrinting'),
+smalltalk.method({
+selector: unescape('testPrinting'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_jsObject", []), "_printString", []), "__eq", [unescape("%5Bobject%20Object%5D")])]);
+return self;},
+args: [],
+source: unescape('testPrinting%0A%09self%20assert%3A%20self%20jsObject%20printString%20%3D%20%27%5Bobject%20Object%5D%27'),
+messageSends: ["assert:", unescape("%3D"), "printString", "jsObject"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
 
 
 smalltalk.addClass('PackageTest', smalltalk.TestCase, ['zorkPackage', 'grulPackage', 'backUpCommitPathJs', 'backUpCommitPathSt'], 'Kernel-Tests');
@@ -1113,5 +1213,717 @@ referencedClasses: ["Object"]
 }),
 smalltalk.ObjectTest);
 
+smalltalk.addMethod(
+unescape('_testHalt'),
+smalltalk.method({
+selector: unescape('testHalt'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_halt", []);}), (smalltalk.Error || Error)]);
+return self;},
+args: [],
+source: unescape('testHalt%0A%09self%20should%3A%20%5BObject%20new%20halt%5D%20raise%3A%20Error'),
+messageSends: ["should:raise:", "halt", "new"],
+referencedClasses: ["Object", "Error"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testBasicAccess'),
+smalltalk.method({
+selector: unescape('testBasicAccess'),
+category: 'tests',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(o, "_basicAt_put_", ["a", (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["a"]), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicAt_", ["b"]), nil]);
+return self;},
+args: [],
+source: unescape('testBasicAccess%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09o%20basicAt%3A%20%27a%27%20put%3A%201.%0A%09self%20assert%3A%20%28o%20basicAt%3A%20%27a%27%29%20equals%3A%201.%0A%09self%20assert%3A%20%28o%20basicAt%3A%20%27b%27%29%20equals%3A%20nil'),
+messageSends: ["new", "basicAt:put:", "assert:equals:", "basicAt:"],
+referencedClasses: ["Object"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testNilUndefined'),
+smalltalk.method({
+selector: unescape('testNilUndefined'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [(typeof undefined == 'undefined' ? nil : undefined)])]);
+return self;},
+args: [],
+source: unescape('testNilUndefined%0A%09%22nil%20in%20Smalltalk%20is%20the%20undefined%20object%20in%20JS%22%0A%0A%09self%20assert%3A%20nil%20%3D%20undefined'),
+messageSends: ["assert:", unescape("%3D")],
+referencedClasses: []
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testidentityHash'),
+smalltalk.method({
+selector: unescape('testidentityHash'),
+category: 'tests',
+fn: function (){
+var self=this;
+var o1=nil;
+var o2=nil;
+o1=smalltalk.send((smalltalk.Object || Object), "_new", []);
+o2=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o1, "_identityHash", [])])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send(o1, "_identityHash", []), "__eq_eq", [smalltalk.send(o2, "_identityHash", [])])]);
+return self;},
+args: [],
+source: unescape('testidentityHash%0A%09%7C%20o1%20o2%20%7C%0A%09%0A%09o1%20%3A%3D%20Object%20new.%0A%09o2%20%3A%3D%20Object%20new.%0A%0A%09self%20assert%3A%20o1%20identityHash%20%3D%3D%20o1%20identityHash.%0A%09self%20deny%3A%20o1%20identityHash%20%3D%3D%20o2%20identityHash'),
+messageSends: ["new", "assert:", unescape("%3D%3D"), "identityHash", "deny:"],
+referencedClasses: ["Object"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testBasicPerform'),
+smalltalk.method({
+selector: unescape('testBasicPerform'),
+category: 'tests',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.Object || Object), "_new", []);
+smalltalk.send(o, "_basicAt_put_", ["func", (function(){return "hello";})]);
+smalltalk.send(o, "_basicAt_put_", ["func2", (function(a){return ((($receiver = a).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_", ["func"]), "hello"]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_basicPerform_withArguments_", ["func2", [(3)]]), (4)]);
+return self;},
+args: [],
+source: unescape('testBasicPerform%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20Object%20new.%0A%09o%20basicAt%3A%20%27func%27%20put%3A%20%5B%27hello%27%5D.%09%0A%09o%20basicAt%3A%20%27func2%27%20put%3A%20%5B%3Aa%20%7C%20a%20+%201%5D.%0A%0A%09self%20assert%3A%20%28o%20basicPerform%3A%20%27func%27%29%09%20equals%3A%20%27hello%27.%0A%09self%20assert%3A%20%28o%20basicPerform%3A%20%27func2%27%20withArguments%3A%20%23%283%29%29%20equals%3A%204'),
+messageSends: ["new", "basicAt:put:", unescape("+"), "assert:equals:", "basicPerform:", "basicPerform:withArguments:"],
+referencedClasses: ["Object"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testIfNil'),
+smalltalk.method({
+selector: unescape('testIfNil'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_isNil", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+smalltalk.send(self, "_assert_", [smalltalk.send((($receiver = smalltalk.send((smalltalk.Object || Object), "_new", [])) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+return self;},
+args: [],
+source: unescape('testIfNil%0A%09self%20deny%3A%20Object%20new%20isNil.%0A%09self%20deny%3A%20%28Object%20new%20ifNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28Object%20new%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%0A%09self%20assert%3A%20%28Object%20new%20ifNil%3A%20%5Bfalse%5D%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28Object%20new%20ifNotNil%3A%20%5Btrue%5D%20ifNil%3A%20%5Bfalse%5D%29%20%3D%20true'),
+messageSends: ["deny:", "isNil", "new", unescape("%3D"), "ifNil:", "assert:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
+referencedClasses: ["Object"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testInstVars'),
+smalltalk.method({
+selector: unescape('testInstVars'),
+category: 'tests',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), nil]);
+smalltalk.send(o, "_instVarAt_put_", [smalltalk.symbolFor("foo"), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", [smalltalk.symbolFor("foo")]), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(o, "_instVarAt_", ["foo"]), (1)]);
+return self;},
+args: [],
+source: unescape('testInstVars%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20ObjectMock%20new.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%23foo%29%20equals%3A%20nil.%0A%0A%09o%20instVarAt%3A%20%23foo%20put%3A%201.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%23foo%29%20equals%3A%201.%0A%09self%20assert%3A%20%28o%20instVarAt%3A%20%27foo%27%29%20equals%3A%201'),
+messageSends: ["new", "assert:equals:", "instVarAt:", "instVarAt:put:"],
+referencedClasses: ["ObjectMock"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testYourself'),
+smalltalk.method({
+selector: unescape('testYourself'),
+category: 'tests',
+fn: function (){
+var self=this;
+var o=nil;
+o=smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
+return self;},
+args: [],
+source: unescape('testYourself%0A%09%7C%20o%20%7C%0A%09o%20%3A%3D%20ObjectMock%20new.%0A%09self%20assert%3A%20o%20yourself%20%3D%3D%20o'),
+messageSends: ["new", "assert:", unescape("%3D%3D"), "yourself"],
+referencedClasses: ["ObjectMock"]
+}),
+smalltalk.ObjectTest);
+
+smalltalk.addMethod(
+unescape('_testDNU'),
+smalltalk.method({
+selector: unescape('testDNU'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Object || Object), "_new", []), "_foo", []);}), (smalltalk.MessageNotUnderstood || MessageNotUnderstood)]);
+return self;},
+args: [],
+source: unescape('testDNU%0A%09self%20should%3A%20%5BObject%20new%20foo%5D%20raise%3A%20MessageNotUnderstood'),
+messageSends: ["should:raise:", "foo", "new"],
+referencedClasses: ["Object", "MessageNotUnderstood"]
+}),
+smalltalk.ObjectTest);
+
+
+
+smalltalk.addClass('SymbolTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testEquality'),
+smalltalk.method({
+selector: unescape('testEquality'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.symbolFor("world")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", ["hello"])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "__eq", [smalltalk.symbolFor("hello")])]);
+return self;},
+args: [],
+source: unescape('testEquality%0A%09self%20assert%3A%20%23hello%20%3D%20%23hello.%0A%09self%20deny%3A%20%23hello%20%3D%20%23world.%0A%0A%09self%20assert%3A%20%23hello%20%20%3D%20%23hello%20yourself.%0A%09self%20assert%3A%20%23hello%20yourself%20%3D%20%23hello.%0A%0A%09self%20deny%3A%20%23hello%20%20%3D%20%27hello%27.%0A%09self%20deny%3A%20%27hello%27%20%3D%20%23hello.'),
+messageSends: ["assert:", unescape("%3D"), "deny:", "yourself"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testAt'),
+smalltalk.method({
+selector: unescape('testAt'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(1)]), "__eq", ["h"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_", [(5)]), "__eq", ["o"])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_at_ifAbsent_", [(6), (function(){return nil;})]), "__eq", [nil])]);
+return self;},
+args: [],
+source: unescape('testAt%0A%09self%20assert%3A%20%28%23hello%20at%3A%201%29%20%3D%20%27h%27.%0A%09self%20assert%3A%20%28%23hello%20at%3A%205%29%20%3D%20%27o%27.%0A%09self%20assert%3A%20%28%23hello%20at%3A%206%20ifAbsent%3A%20%5Bnil%5D%29%20%3D%20nil'),
+messageSends: ["assert:", unescape("%3D"), "at:", "at:ifAbsent:"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testAtPut'),
+smalltalk.method({
+selector: unescape('testAtPut'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send("hello", "_at_put_", [(1), "a"]);}), (smalltalk.Error || Error)]);
+return self;},
+args: [],
+source: unescape('testAtPut%0A%09%22Symbol%20instances%20are%20read-only%22%0A%09self%20should%3A%20%5B%27hello%27%20at%3A%201%20put%3A%20%27a%27%5D%20raise%3A%20Error'),
+messageSends: ["should:raise:", "at:put:"],
+referencedClasses: ["Error"]
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testIdentity'),
+smalltalk.method({
+selector: unescape('testIdentity'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.symbolFor("world")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_yourself", []), "__eq", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "_asSymbol", [])])]);
+return self;},
+args: [],
+source: unescape('testIdentity%0A%09self%20assert%3A%20%23hello%20%3D%3D%20%23hello.%0A%09self%20deny%3A%20%23hello%20%3D%3D%20%23world.%0A%0A%09self%20assert%3A%20%23hello%20%20%3D%20%23hello%20yourself.%0A%09self%20assert%3A%20%23hello%20yourself%20%3D%20%23hello%20asString%20asSymbol'),
+messageSends: ["assert:", unescape("%3D%3D"), "deny:", unescape("%3D"), "yourself", "asSymbol", "asString"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testComparing'),
+smalltalk.method({
+selector: unescape('testComparing'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("aa")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("aa") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("aa")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver >=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__gt_eq", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_assert_", [((($receiver = smalltalk.symbolFor("ab")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
+smalltalk.send(self, "_deny_", [((($receiver = smalltalk.symbolFor("bb")).klass === smalltalk.Number) ? $receiver <=smalltalk.symbolFor("ba") : smalltalk.send($receiver, "__lt_eq", [smalltalk.symbolFor("ba")]))]);
+return self;},
+args: [],
+source: unescape('testComparing%0A%09self%20assert%3A%20%23ab%20%3E%20%23aa.%0A%09self%20deny%3A%20%23ab%20%3E%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3C%20%23ba.%0A%09self%20deny%3A%20%23bb%20%3C%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3E%3D%20%23aa.%0A%09self%20deny%3A%20%23ab%20%3E%3D%20%23ba.%0A%0A%09self%20assert%3A%20%23ab%20%3C%3D%20%23ba.%0A%09self%20deny%3A%20%23bb%20%3C%3D%20%23ba%0A%0A%09%09'),
+messageSends: ["assert:", unescape("%3E"), "deny:", unescape("%3C"), unescape("%3E%3D"), unescape("%3C%3D")],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testSize'),
+smalltalk.method({
+selector: unescape('testSize'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("a"), "_size", []), (1)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("aaaaa"), "_size", []), (5)]);
+return self;},
+args: [],
+source: unescape('testSize%0A%09self%20assert%3A%20%23a%20size%20equals%3A%201.%0A%09self%20assert%3A%20%23aaaaa%20size%20equals%3A%205'),
+messageSends: ["assert:equals:", "size"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testAsString'),
+smalltalk.method({
+selector: unescape('testAsString'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.symbolFor("hello"), "_asString", []), "hello"]);
+return self;},
+args: [],
+source: unescape('testAsString%0A%09self%20assert%3A%20%23hello%20asString%20equals%3A%20%27hello%27'),
+messageSends: ["assert:equals:", "asString"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testAsSymbol'),
+smalltalk.method({
+selector: unescape('testAsSymbol'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "__eq_eq", [smalltalk.send(smalltalk.symbolFor("hello"), "_asSymbol", [])])]);
+return self;},
+args: [],
+source: unescape('testAsSymbol%0A%09self%20assert%3A%20%23hello%20%3D%3D%20%23hello%20asSymbol'),
+messageSends: ["assert:", unescape("%3D%3D"), "asSymbol"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testCopying'),
+smalltalk.method({
+selector: unescape('testCopying'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_copy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.symbolFor("hello"), "_deepCopy", []), "__eq_eq", [smalltalk.symbolFor("hello")])]);
+return self;},
+args: [],
+source: unescape('testCopying%0A%09self%20assert%3A%20%23hello%20copy%20%3D%3D%20%23hello.%0A%09self%20assert%3A%20%23hello%20deepCopy%20%3D%3D%20%23hello'),
+messageSends: ["assert:", unescape("%3D%3D"), "copy", "deepCopy"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+smalltalk.addMethod(
+unescape('_testIsSymbolIsString'),
+smalltalk.method({
+selector: unescape('testIsSymbolIsString'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isSymbol", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send("hello", "_isSymbol", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.symbolFor("hello"), "_isString", [])]);
+smalltalk.send(self, "_assert_", [smalltalk.send("hello", "_isString", [])]);
+return self;},
+args: [],
+source: unescape('testIsSymbolIsString%0A%09self%20assert%3A%20%23hello%20isSymbol.%0A%09self%20deny%3A%20%27hello%27%20isSymbol.%0A%09self%20deny%3A%20%23hello%20isString.%0A%09self%20assert%3A%20%27hello%27%20isString'),
+messageSends: ["assert:", "isSymbol", "deny:", "isString"],
+referencedClasses: []
+}),
+smalltalk.SymbolTest);
+
+
+
+smalltalk.addClass('ObjectMock', smalltalk.Object, ['foo', 'bar'], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_foo'),
+smalltalk.method({
+selector: unescape('foo'),
+category: 'not yet classified',
+fn: function (){
+var self=this;
+return self['@foo'];
+return self;},
+args: [],
+source: unescape('foo%0A%09%5Efoo'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ObjectMock);
+
+smalltalk.addMethod(
+unescape('_foo_'),
+smalltalk.method({
+selector: unescape('foo%3A'),
+category: 'not yet classified',
+fn: function (anObject){
+var self=this;
+self['@foo']=anObject;
+return self;},
+args: ["anObject"],
+source: unescape('foo%3A%20anObject%0A%09foo%20%3A%3D%20anObject'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ObjectMock);
+
+
+
+smalltalk.addClass('UndefinedTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testIsNil'),
+smalltalk.method({
+selector: unescape('testIsNil'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(nil, "_isNil", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(nil, "_notNil", [])]);
+return self;},
+args: [],
+source: unescape('testIsNil%0A%09self%20assert%3A%20nil%20isNil.%0A%09self%20deny%3A%20nil%20notNil.'),
+messageSends: ["assert:", "isNil", "deny:", "notNil"],
+referencedClasses: []
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+unescape('_testIfNil'),
+smalltalk.method({
+selector: unescape('testIfNil'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver, true]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) != nil && $receiver != undefined) ? (function(){return true;})() : nil, "__eq", [true])]);
+smalltalk.send(self, "_assert_equals_", [(($receiver = nil) == nil || $receiver == undefined) ? (function(){return true;})() : (function(){return false;})(), true]);
+smalltalk.send(self, "_deny_", [smalltalk.send((($receiver = nil) == nil || $receiver == undefined) ? (function(){return false;})() : (function(){return true;})(), "__eq", [true])]);
+return self;},
+args: [],
+source: unescape('testIfNil%0A%09self%20assert%3A%20%28nil%20ifNil%3A%20%5Btrue%5D%29%20equals%3A%20true.%0A%09self%20deny%3A%20%28nil%20ifNotNil%3A%20%5Btrue%5D%29%20%3D%20true.%0A%09self%20assert%3A%20%28nil%20ifNil%3A%20%5Btrue%5D%20ifNotNil%3A%20%5Bfalse%5D%29%20equals%3A%20true.%0A%09self%20deny%3A%20%28nil%20ifNotNil%3A%20%5Btrue%5D%20ifNil%3A%20%5Bfalse%5D%29%20%3D%20true'),
+messageSends: ["assert:equals:", "ifNil:", "deny:", unescape("%3D"), "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"],
+referencedClasses: []
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+unescape('_testCopying'),
+smalltalk.method({
+selector: unescape('testCopying'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(nil, "_copy", []), nil]);
+return self;},
+args: [],
+source: unescape('testCopying%0A%09self%20assert%3A%20nil%20copy%20equals%3A%20nil'),
+messageSends: ["assert:equals:", "copy"],
+referencedClasses: []
+}),
+smalltalk.UndefinedTest);
+
+smalltalk.addMethod(
+unescape('_testDeepCopy'),
+smalltalk.method({
+selector: unescape('testDeepCopy'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(nil, "_deepCopy", []), "__eq", [nil])]);
+return self;},
+args: [],
+source: unescape('testDeepCopy%0A%09self%20assert%3A%20nil%20deepCopy%20%3D%20nil'),
+messageSends: ["assert:", unescape("%3D"), "deepCopy"],
+referencedClasses: []
+}),
+smalltalk.UndefinedTest);
+
+
+
+smalltalk.addClass('PointTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testAccessing'),
+smalltalk.method({
+selector: unescape('testAccessing'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_x", []), (3)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)]), "_y", []), (4)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_x_", [(3)]), "_x", []), (3)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Point || Point), "_new", []), "_y_", [(4)]), "_y", []), (4)]);
+return self;},
+args: [],
+source: unescape('testAccessing%0A%09self%20assert%3A%20%28Point%20x%3A%203%20y%3A%204%29%20x%20equals%3A%203.%0A%09self%20assert%3A%20%28Point%20x%3A%203%20y%3A%204%29%20y%20equals%3A%204.%0A%09self%20assert%3A%20%28Point%20new%20x%3A%203%29%20x%20equals%3A%203.%0A%09self%20assert%3A%20%28Point%20new%20y%3A%204%29%20y%20equals%3A%204'),
+messageSends: ["assert:equals:", "x", "x:y:", "y", "x:", "new", "y:"],
+referencedClasses: ["Point"]
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+unescape('_testAt'),
+smalltalk.method({
+selector: unescape('testAt'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send((3), "__at", [(4)]), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(3), (4)])]);
+return self;},
+args: [],
+source: unescape('testAt%0A%09self%20assert%3A%203@4%20equals%3A%20%28Point%20x%3A%203%20y%3A%204%29'),
+messageSends: ["assert:equals:", unescape("@"), "x:y:"],
+referencedClasses: ["Point"]
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+unescape('_testEgality'),
+smalltalk.method({
+selector: unescape('testEgality'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send((3), "__at", [(4)]), "__eq", [smalltalk.send((3), "__at", [(4)])])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(smalltalk.send((3), "__at", [(5)]), "__eq", [smalltalk.send((3), "__at", [(6)])])]);
+return self;},
+args: [],
+source: unescape('testEgality%0A%09self%20assert%3A%203@4%20%3D%20%283@4%29.%0A%09self%20deny%3A%203@5%20%3D%20%283@6%29'),
+messageSends: ["assert:", unescape("%3D"), unescape("@"), "deny:"],
+referencedClasses: []
+}),
+smalltalk.PointTest);
+
+smalltalk.addMethod(
+unescape('_testArithmetic'),
+smalltalk.method({
+selector: unescape('testArithmetic'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__star", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(9), (16)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver +smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(6), (8)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((3), "__at", [(4)])).klass === smalltalk.Number) ? $receiver -smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__minus", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(0), (0)])]);
+smalltalk.send(self, "_assert_equals_", [((($receiver = smalltalk.send((6), "__at", [(8)])).klass === smalltalk.Number) ? $receiver /smalltalk.send((3), "__at", [(4)]) : smalltalk.send($receiver, "__slash", [smalltalk.send((3), "__at", [(4)])])), smalltalk.send((smalltalk.Point || Point), "_x_y_", [(2), (2)])]);
+return self;},
+args: [],
+source: unescape('testArithmetic%0A%09self%20assert%3A%203@4%20*%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%209%20y%3A%2016%29.%0A%09self%20assert%3A%203@4%20+%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%206%20y%3A%208%29.%0A%09self%20assert%3A%203@4%20-%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%200%20y%3A%200%29.%0A%09self%20assert%3A%206@8%20/%20%283@4%20%29%20equals%3A%20%28Point%20x%3A%202%20y%3A%202%29'),
+messageSends: ["assert:equals:", unescape("*"), unescape("@"), "x:y:", unescape("+"), unescape("-"), unescape("/")],
+referencedClasses: ["Point"]
+}),
+smalltalk.PointTest);
+
+
+
+smalltalk.addClass('RandomTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_textNext'),
+smalltalk.method({
+selector: unescape('textNext'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send((10000), "_timesRepeat_", [(function(){var current=nil;
+var next=nil;
+next=smalltalk.send(smalltalk.send((smalltalk.Random || Random), "_new", []), "_next", []);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver >=(0) : smalltalk.send($receiver, "__gt_eq", [(0)]))]);smalltalk.send(self, "_assert_", [((($receiver = next).klass === smalltalk.Number) ? $receiver <(1) : smalltalk.send($receiver, "__lt", [(1)]))]);smalltalk.send(self, "_deny_", [smalltalk.send(current, "__eq", [next])]);return smalltalk.send(next, "__eq", [current]);})]);
+return self;},
+args: [],
+source: unescape('textNext%0A%0A%0910000%20timesRepeat%3A%20%5B%0A%09%09%09%7C%20current%20next%20%7C%20%0A%09%09%09next%20%3A%3D%20Random%20new%20next.%0A%09%09%09self%20assert%3A%20%28next%20%3E%3D%200%29.%0A%09%09%09self%20assert%3A%20%28next%20%3C%201%29.%0A%09%09%09self%20deny%3A%20current%20%3D%20next.%0A%09%09%09next%20%3D%20current%5D'),
+messageSends: ["timesRepeat:", "next", "new", "assert:", unescape("%3E%3D"), unescape("%3C"), "deny:", unescape("%3D")],
+referencedClasses: ["Random"]
+}),
+smalltalk.RandomTest);
+
+
+
+smalltalk.addClass('ClassBuilderTest', smalltalk.TestCase, ['builder', 'theClass'], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_setUp'),
+smalltalk.method({
+selector: unescape('setUp'),
+category: 'running',
+fn: function (){
+var self=this;
+self['@builder']=smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []);
+return self;},
+args: [],
+source: unescape('setUp%0A%09builder%20%3A%3D%20ClassBuilder%20new'),
+messageSends: ["new"],
+referencedClasses: ["ClassBuilder"]
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+unescape('_tearDown'),
+smalltalk.method({
+selector: unescape('tearDown'),
+category: 'running',
+fn: function (){
+var self=this;
+(($receiver = self['@theClass']) != nil && $receiver != undefined) ? (function(){smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_removeClass_", [self['@theClass']]);return self['@theClass']=nil;})() : nil;
+return self;},
+args: [],
+source: unescape('tearDown%0A%09theClass%20ifNotNil%3A%20%5BSmalltalk%20current%20removeClass%3A%20theClass.%20theClass%20%3A%3D%20nil%5D'),
+messageSends: ["ifNotNil:", "removeClass:", "current"],
+referencedClasses: ["Smalltalk"]
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+unescape('_testClassCopy'),
+smalltalk.method({
+selector: unescape('testClassCopy'),
+category: 'running',
+fn: function (){
+var self=this;
+self['@theClass']=smalltalk.send(self['@builder'], "_copyClass_named_", [(smalltalk.ObjectMock || ObjectMock), "ObjectMock2"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_superclass", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_superclass", [])])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_instanceVariableNames", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_instanceVariableNames", [])])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@theClass'], "_name", []), "ObjectMock2"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@theClass'], "_package", []), "__eq_eq", [smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_package", [])])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send(self['@theClass'], "_methodDictionary", []), "_keys", []), smalltalk.send(smalltalk.send((smalltalk.ObjectMock || ObjectMock), "_methodDictionary", []), "_keys", [])]);
+return self;},
+args: [],
+source: unescape('testClassCopy%0A%09theClass%20%3A%3D%20builder%20copyClass%3A%20ObjectMock%20named%3A%20%27ObjectMock2%27.%0A%09self%20assert%3A%20theClass%20superclass%20%3D%3D%20ObjectMock%20superclass.%0A%09self%20assert%3A%20theClass%20instanceVariableNames%20%3D%3D%20ObjectMock%20instanceVariableNames.%0A%09self%20assert%3A%20theClass%20name%20equals%3A%20%27ObjectMock2%27.%0A%09self%20assert%3A%20theClass%20package%20%3D%3D%20ObjectMock%20package.%0A%09self%20assert%3A%20theClass%20methodDictionary%20keys%20equals%3A%20ObjectMock%20methodDictionary%20keys'),
+messageSends: ["copyClass:named:", "assert:", unescape("%3D%3D"), "superclass", "instanceVariableNames", "assert:equals:", "name", "package", "keys", "methodDictionary"],
+referencedClasses: ["ObjectMock"]
+}),
+smalltalk.ClassBuilderTest);
+
+smalltalk.addMethod(
+unescape('_testInstanceVariableNames'),
+smalltalk.method({
+selector: unescape('testInstanceVariableNames'),
+category: 'running',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(self['@builder'], "_instanceVariableNamesFor_", ["  hello   world   "]), ["hello", "world"]]);
+return self;},
+args: [],
+source: unescape('testInstanceVariableNames%0A%09self%20assert%3A%20%28builder%20instanceVariableNamesFor%3A%20%27%20%20hello%20%20%20world%20%20%20%27%29%20equals%3A%20%23%28%27hello%27%20%27world%27%29'),
+messageSends: ["assert:equals:", "instanceVariableNamesFor:"],
+referencedClasses: []
+}),
+smalltalk.ClassBuilderTest);
+
+
+
+smalltalk.addClass('SetTest', smalltalk.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+unescape('_testUnicity'),
+smalltalk.method({
+selector: unescape('testUnicity'),
+category: 'tests',
+fn: function (){
+var self=this;
+var set=nil;
+set=smalltalk.send((smalltalk.Set || Set), "_new", []);
+smalltalk.send(set, "_add_", [(21)]);
+smalltalk.send(set, "_add_", ["hello"]);
+smalltalk.send(set, "_add_", [(21)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
+smalltalk.send(set, "_add_", ["hello"]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(set, "_size", []), "__eq", [(2)])]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(set, "_asArray", []), [(21), "hello"]]);
+return self;},
+args: [],
+source: unescape('testUnicity%0A%09%7C%20set%20%7C%0A%09set%20%3A%3D%20Set%20new.%0A%09set%20add%3A%2021.%0A%09set%20add%3A%20%27hello%27.%0A%0A%09set%20add%3A%2021.%0A%09self%20assert%3A%20set%20size%20%3D%202.%0A%09%0A%09set%20add%3A%20%27hello%27.%0A%09self%20assert%3A%20set%20size%20%3D%202.%0A%0A%09self%20assert%3A%20set%20asArray%20equals%3A%20%23%2821%20%27hello%27%29'),
+messageSends: ["new", "add:", "assert:", unescape("%3D"), "size", "assert:equals:", "asArray"],
+referencedClasses: ["Set"]
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+unescape('_testAt'),
+smalltalk.method({
+selector: unescape('testAt'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_should_raise_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_at_put_", [(1), (2)]);}), (smalltalk.Error || Error)]);
+return self;},
+args: [],
+source: unescape('testAt%0A%09self%20should%3A%20%5BSet%20new%20at%3A%201%20put%3A%202%5D%20raise%3A%20Error'),
+messageSends: ["should:raise:", "at:put:", "new"],
+referencedClasses: ["Set", "Error"]
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+unescape('_testAddRemove'),
+smalltalk.method({
+selector: unescape('testAddRemove'),
+category: 'tests',
+fn: function (){
+var self=this;
+var set=nil;
+set=smalltalk.send((smalltalk.Set || Set), "_new", []);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_isEmpty", [])]);
+smalltalk.send(set, "_add_", [(3)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(3)])]);
+smalltalk.send(set, "_add_", [(5)]);
+smalltalk.send(self, "_assert_", [smalltalk.send(set, "_includes_", [(5)])]);
+smalltalk.send(set, "_remove_", [(3)]);
+smalltalk.send(self, "_deny_", [smalltalk.send(set, "_includes_", [(3)])]);
+return self;},
+args: [],
+source: unescape('testAddRemove%0A%09%7C%20set%20%7C%0A%09set%20%3A%3D%20Set%20new.%0A%09%0A%09self%20assert%3A%20set%20isEmpty.%0A%0A%09set%20add%3A%203.%0A%09self%20assert%3A%20%28set%20includes%3A%203%29.%0A%0A%09set%20add%3A%205.%0A%09self%20assert%3A%20%28set%20includes%3A%205%29.%0A%0A%09set%20remove%3A%203.%0A%09self%20deny%3A%20%28set%20includes%3A%203%29'),
+messageSends: ["new", "assert:", "isEmpty", "add:", "includes:", "remove:", "deny:"],
+referencedClasses: ["Set"]
+}),
+smalltalk.SetTest);
+
+smalltalk.addMethod(
+unescape('_testSize'),
+smalltalk.method({
+selector: unescape('testSize'),
+category: 'tests',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_new", []), "_size", []), (0)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (2), (3), (4)]]), "_size", []), (4)]);
+smalltalk.send(self, "_assert_equals_", [smalltalk.send(smalltalk.send((smalltalk.Set || Set), "_withAll_", [[(1), (1), (1), (1)]]), "_size", []), (1)]);
+return self;},
+args: [],
+source: unescape('testSize%0A%09self%20assert%3A%20Set%20new%20size%20equals%3A%200.%0A%09self%20assert%3A%20%28Set%20withAll%3A%20%23%281%202%203%204%29%29%20size%20equals%3A%204.%0A%09self%20assert%3A%20%28Set%20withAll%3A%20%23%281%201%201%201%29%29%20size%20equals%3A%201'),
+messageSends: ["assert:equals:", "size", "new", "withAll:"],
+referencedClasses: ["Set"]
+}),
+smalltalk.SetTest);
+
 
 

+ 6 - 5
st/Kernel-Collections.st

@@ -469,19 +469,19 @@ asciiValue
 !
 
 > aString
-	<return String(self) >> aString>
+	<return String(self) >> aString._asString()>
 !
 
 < aString
-	<return String(self) < aString>
+	<return String(self) < aString._asString()>
 !
 
 >= aString
-	<return String(self) >>= aString>
+	<return String(self) >>= aString._asString()>
 !
 
 <= aString
-	<return String(self) <= aString>
+	<return String(self) <= aString._asString()>
 ! !
 
 !String methodsFor: 'converting'!
@@ -772,6 +772,7 @@ size
 !
 
 = aSymbol
+	aSymbol class = self class ifFalse: [^false].
 	^self asString = aSymbol asString
 !
 
@@ -803,7 +804,7 @@ deepCopy
 	^self
 !
 
-shadowCopy
+shallowCopy
 	^self
 ! !
 

+ 18 - 0
st/Kernel-Methods.st

@@ -153,6 +153,24 @@ ensure: aBlock
 		do: [:ex |
 			success ifFalse: [aBlock value].
 			ex signal]
+!
+
+newValue: anObject
+	"Use the receiver as a JS constructor. 
+	*Do not* use this method to instanciate Smalltalk objects!!"
+	<return new self(anObject)>
+!
+
+newValue:  anObject value: anObject2
+	"Use the receiver as a JS constructor. 
+	*Do not* use this method to instanciate Smalltalk objects!!"
+	<return new self(anObject, anObject2)>
+!
+
+newValue:  anObject value: anObject2 value: anObject3
+	"Use the receiver as a JS constructor. 
+	*Do not* use this method to instanciate Smalltalk objects!!"
+	<return new self(anObject, anObject2)>
 ! !
 
 !BlockClosure methodsFor: 'timeout/interval'!

+ 8 - 4
st/Kernel-Objects.st

@@ -17,12 +17,16 @@ size
 	self error: 'Object not indexable'
 !
 
-instVarAt: aString
-	<return self['@'+aString]>
+instVarAt: aSymbol
+	| varname |
+	varname := aSymbol asString.
+	<return self['@'+varname]>
 !
 
-instVarAt: aString put: anObject
-	<self['@' + aString] = anObject>
+instVarAt: aSymbol put: anObject
+	| varname |
+	varname := aSymbol asString.
+	<self['@' + varname] = anObject>
 !
 
 basicAt: aString

+ 333 - 0
st/Kernel-Tests.st

@@ -48,6 +48,16 @@ testAt
 testAtPut
 	"String instances are read-only"
 	self should: ['hello' at: 1 put: 'a'] raise: Error
+!
+
+testSize
+	self assert: 'smalltalk' size equals: 9.
+	self assert: '' size equals: 0
+!
+
+testAddRemove
+	self should: ['hello' add: 'a'] raise: Error.
+	self should: ['hello' remove: 'h'] raise: Error
 ! !
 
 TestCase subclass: #DictionaryTest
@@ -360,6 +370,12 @@ TestCase subclass: #JSObjectProxyTest
 	instanceVariableNames: ''
 	category: 'Kernel-Tests'!
 
+!JSObjectProxyTest methodsFor: 'accessing'!
+
+jsObject
+	<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}}>
+! !
+
 !JSObjectProxyTest methodsFor: 'tests'!
 
 testMethodWithArguments
@@ -390,6 +406,21 @@ testPropertyThatReturnsEmptyString
 
 	document location hash: 'test'.
 	self assert: '#test' equals: document location hash.
+!
+
+testDNU
+	self should: [self jsObject foo] raise: MessageNotUnderstood
+!
+
+testMessageSend
+
+	self assert: self jsObject a equals: 1.
+	self assert: self jsObject b equals: 2.
+	self assert: (self jsObject c: 3) equals: 3
+!
+
+testPrinting
+	self assert: self jsObject printString = '[object Object]'
 ! !
 
 TestCase subclass: #PackageTest
@@ -555,5 +586,307 @@ testIdentity
 	o := Object new.
 	self deny: o == Object new.
 	self assert: o == o
+!
+
+testHalt
+	self should: [Object new halt] raise: Error
+!
+
+testBasicAccess
+	| o |
+	o := Object new.
+	o basicAt: 'a' put: 1.
+	self assert: (o basicAt: 'a') equals: 1.
+	self assert: (o basicAt: 'b') equals: nil
+!
+
+testNilUndefined
+	"nil in Smalltalk is the undefined object in JS"
+
+	self assert: nil = undefined
+!
+
+testidentityHash
+	| o1 o2 |
+	
+	o1 := Object new.
+	o2 := Object new.
+
+	self assert: o1 identityHash == o1 identityHash.
+	self deny: o1 identityHash == o2 identityHash
+!
+
+testBasicPerform
+	| o |
+	o := Object new.
+	o basicAt: 'func' put: ['hello'].	
+	o basicAt: 'func2' put: [:a | a + 1].
+
+	self assert: (o basicPerform: 'func')	 equals: 'hello'.
+	self assert: (o basicPerform: 'func2' withArguments: #(3)) equals: 4
+!
+
+testIfNil
+	self deny: Object new isNil.
+	self deny: (Object new ifNil: [true]) = true.
+	self assert: (Object new ifNotNil: [true]) = true.
+
+	self assert: (Object new ifNil: [false] ifNotNil: [true]) = true.
+	self assert: (Object new ifNotNil: [true] ifNil: [false]) = true
+!
+
+testInstVars
+	| o |
+	o := ObjectMock new.
+	self assert: (o instVarAt: #foo) equals: nil.
+
+	o instVarAt: #foo put: 1.
+	self assert: (o instVarAt: #foo) equals: 1.
+	self assert: (o instVarAt: 'foo') equals: 1
+!
+
+testYourself
+	| o |
+	o := ObjectMock new.
+	self assert: o yourself == o
+!
+
+testDNU
+	self should: [Object new foo] raise: MessageNotUnderstood
+! !
+
+TestCase subclass: #SymbolTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!SymbolTest methodsFor: 'tests'!
+
+testEquality
+	self assert: #hello = #hello.
+	self deny: #hello = #world.
+
+	self assert: #hello  = #hello yourself.
+	self assert: #hello yourself = #hello.
+
+	self deny: #hello  = 'hello'.
+	self deny: 'hello' = #hello.
+!
+
+testAt
+	self assert: (#hello at: 1) = 'h'.
+	self assert: (#hello at: 5) = 'o'.
+	self assert: (#hello at: 6 ifAbsent: [nil]) = nil
+!
+
+testAtPut
+	"Symbol instances are read-only"
+	self should: ['hello' at: 1 put: 'a'] raise: Error
+!
+
+testIdentity
+	self assert: #hello == #hello.
+	self deny: #hello == #world.
+
+	self assert: #hello  = #hello yourself.
+	self assert: #hello yourself = #hello asString asSymbol
+!
+
+testComparing
+	self assert: #ab > #aa.
+	self deny: #ab > #ba.
+
+	self assert: #ab < #ba.
+	self deny: #bb < #ba.
+
+	self assert: #ab >= #aa.
+	self deny: #ab >= #ba.
+
+	self assert: #ab <= #ba.
+	self deny: #bb <= #ba
+!
+
+testSize
+	self assert: #a size equals: 1.
+	self assert: #aaaaa size equals: 5
+!
+
+testAsString
+	self assert: #hello asString equals: 'hello'
+!
+
+testAsSymbol
+	self assert: #hello == #hello asSymbol
+!
+
+testCopying
+	self assert: #hello copy == #hello.
+	self assert: #hello deepCopy == #hello
+!
+
+testIsSymbolIsString
+	self assert: #hello isSymbol.
+	self deny: 'hello' isSymbol.
+	self deny: #hello isString.
+	self assert: 'hello' isString
+! !
+
+Object subclass: #ObjectMock
+	instanceVariableNames: 'foo bar'
+	category: 'Kernel-Tests'!
+
+!ObjectMock methodsFor: 'not yet classified'!
+
+foo
+	^foo
+!
+
+foo: anObject
+	foo := anObject
+! !
+
+TestCase subclass: #UndefinedTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!UndefinedTest methodsFor: 'tests'!
+
+testIsNil
+	self assert: nil isNil.
+	self deny: nil notNil.
+!
+
+testIfNil
+	self assert: (nil ifNil: [true]) equals: true.
+	self deny: (nil ifNotNil: [true]) = true.
+	self assert: (nil ifNil: [true] ifNotNil: [false]) equals: true.
+	self deny: (nil ifNotNil: [true] ifNil: [false]) = true
+!
+
+testCopying
+	self assert: nil copy equals: nil
+!
+
+testDeepCopy
+	self assert: nil deepCopy = nil
+! !
+
+TestCase subclass: #PointTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!PointTest methodsFor: 'tests'!
+
+testAccessing
+	self assert: (Point x: 3 y: 4) x equals: 3.
+	self assert: (Point x: 3 y: 4) y equals: 4.
+	self assert: (Point new x: 3) x equals: 3.
+	self assert: (Point new y: 4) y equals: 4
+!
+
+testAt
+	self assert: 3@4 equals: (Point x: 3 y: 4)
+!
+
+testEgality
+	self assert: 3@4 = (3@4).
+	self deny: 3@5 = (3@6)
+!
+
+testArithmetic
+	self assert: 3@4 * (3@4 ) equals: (Point x: 9 y: 16).
+	self assert: 3@4 + (3@4 ) equals: (Point x: 6 y: 8).
+	self assert: 3@4 - (3@4 ) equals: (Point x: 0 y: 0).
+	self assert: 6@8 / (3@4 ) equals: (Point x: 2 y: 2)
+! !
+
+TestCase subclass: #RandomTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!RandomTest methodsFor: 'tests'!
+
+textNext
+
+	10000 timesRepeat: [
+			| current next | 
+			next := Random new next.
+			self assert: (next >= 0).
+			self assert: (next < 1).
+			self deny: current = next.
+			next = current]
+! !
+
+TestCase subclass: #ClassBuilderTest
+	instanceVariableNames: 'builder theClass'
+	category: 'Kernel-Tests'!
+
+!ClassBuilderTest methodsFor: 'running'!
+
+setUp
+	builder := ClassBuilder new
+!
+
+tearDown
+	theClass ifNotNil: [Smalltalk current removeClass: theClass. theClass := nil]
+!
+
+testClassCopy
+	theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.
+	self assert: theClass superclass == ObjectMock superclass.
+	self assert: theClass instanceVariableNames == ObjectMock instanceVariableNames.
+	self assert: theClass name equals: 'ObjectMock2'.
+	self assert: theClass package == ObjectMock package.
+	self assert: theClass methodDictionary keys equals: ObjectMock methodDictionary keys
+!
+
+testInstanceVariableNames
+	self assert: (builder instanceVariableNamesFor: '  hello   world   ') equals: #('hello' 'world')
+! !
+
+TestCase subclass: #SetTest
+	instanceVariableNames: ''
+	category: 'Kernel-Tests'!
+
+!SetTest methodsFor: 'tests'!
+
+testUnicity
+	| set |
+	set := Set new.
+	set add: 21.
+	set add: 'hello'.
+
+	set add: 21.
+	self assert: set size = 2.
+	
+	set add: 'hello'.
+	self assert: set size = 2.
+
+	self assert: set asArray equals: #(21 'hello')
+!
+
+testAt
+	self should: [Set new at: 1 put: 2] raise: Error
+!
+
+testAddRemove
+	| set |
+	set := Set new.
+	
+	self assert: set isEmpty.
+
+	set add: 3.
+	self assert: (set includes: 3).
+
+	set add: 5.
+	self assert: (set includes: 5).
+
+	set remove: 3.
+	self deny: (set includes: 3)
+!
+
+testSize
+	self assert: Set new size equals: 0.
+	self assert: (Set withAll: #(1 2 3 4)) size equals: 4.
+	self assert: (Set withAll: #(1 1 1 1)) size equals: 1
 ! !