Browse Source

Build test for nodejs

Nicolas Petton 12 years ago
parent
commit
52a1183052
9 changed files with 494 additions and 384 deletions
  1. 5 7
      js/Kernel-Tests.deploy.js
  2. 7 9
      js/Kernel-Tests.js
  3. 175 180
      js/SUnit.deploy.js
  4. 175 180
      js/SUnit.js
  5. 5 8
      st/Kernel-Tests.st
  6. 40 0
      test/Test.deploy.js
  7. 50 0
      test/Test.js
  8. 27 0
      test/Test.st
  9. 10 0
      test/run_build.sh

+ 5 - 7
js/Kernel-Tests.deploy.js

@@ -1545,14 +1545,12 @@ selector: "testYourself",
 fn: function () {
 fn: function () {
     var self = this;
     var self = this;
     var $1, $2;
     var $1, $2;
-    var body;
-    $1 = smalltalk.send("body", "_asJQuery", []);
-    smalltalk.send($1, "_addClass_", ["amber"]);
+    var object;
+    $1 = smalltalk.send(self, "_jsObject", []);
+    smalltalk.send($1, "_d_", ["test"]);
     $2 = smalltalk.send($1, "_yourself", []);
     $2 = smalltalk.send($1, "_yourself", []);
-    body = $2;
-    smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
-    smalltalk.send(body, "_removeClass_", ["amber"]);
-    smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+    object = $2;
+    smalltalk.send(self, "_assert_equals_", [smalltalk.send(object, "_d", []), "test"]);
     return self;
     return self;
 }
 }
 }),
 }),

+ 7 - 9
js/Kernel-Tests.js

@@ -2041,19 +2041,17 @@ category: 'tests',
 fn: function () {
 fn: function () {
     var self = this;
     var self = this;
     var $1, $2;
     var $1, $2;
-    var body;
-    $1 = smalltalk.send("body", "_asJQuery", []);
-    smalltalk.send($1, "_addClass_", ["amber"]);
+    var object;
+    $1 = smalltalk.send(self, "_jsObject", []);
+    smalltalk.send($1, "_d_", ["test"]);
     $2 = smalltalk.send($1, "_yourself", []);
     $2 = smalltalk.send($1, "_yourself", []);
-    body = $2;
-    smalltalk.send(self, "_assert_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
-    smalltalk.send(body, "_removeClass_", ["amber"]);
-    smalltalk.send(self, "_deny_", [smalltalk.send(body, "_hasClass_", ["amber"])]);
+    object = $2;
+    smalltalk.send(self, "_assert_equals_", [smalltalk.send(object, "_d", []), "test"]);
     return self;
     return self;
 },
 },
 args: [],
 args: [],
-source: "testYourself\x0a\x09|body|\x0a\x09body := 'body' asJQuery\x0a\x09\x09\x09\x09addClass: 'amber';\x0a\x09\x09\x09\x09yourself.\x0a\x0a\x09self assert: (body hasClass: 'amber').\x0a\x0a\x09body removeClass: 'amber'.\x0a\x09self deny: (body hasClass: 'amber').",
-messageSends: ["addClass:", "asJQuery", "yourself", "assert:", "hasClass:", "removeClass:", "deny:"],
+source: "testYourself\x0a\x09| object |\x0a\x09object := self jsObject\x0a\x09\x09d: 'test';\x0a\x09\x09yourself.\x0a\x0a\x09self assert: object d equals: 'test'",
+messageSends: ["d:", "jsObject", "yourself", "assert:equals:", "d"],
 referencedClasses: []
 referencedClasses: []
 }),
 }),
 smalltalk.JSObjectProxyTest);
 smalltalk.JSObjectProxyTest);

+ 175 - 180
js/SUnit.deploy.js

@@ -4,10 +4,11 @@ smalltalk.addMethod(
 "_assert_",
 "_assert_",
 smalltalk.method({
 smalltalk.method({
 selector: "assert:",
 selector: "assert:",
-fn: function (aBoolean){
-var self=this;
-smalltalk.send(self,"_assert_description_",[aBoolean,"Assertion failed"]);
-return self}
+fn: function (aBoolean) {
+    var self = this;
+    smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -15,12 +16,13 @@ smalltalk.addMethod(
 "_assert_description_",
 "_assert_description_",
 smalltalk.method({
 smalltalk.method({
 selector: "assert:description:",
 selector: "assert:description:",
-fn: function (aBoolean,aString){
-var self=this;
-if(! smalltalk.assert(aBoolean)){
-smalltalk.send(self,"_signalFailure_",[aString]);
-};
-return self}
+fn: function (aBoolean, aString) {
+    var self = this;
+    if (!smalltalk.assert(aBoolean)) {
+        smalltalk.send(self, "_signalFailure_", [aString]);
+    }
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -28,11 +30,11 @@ smalltalk.addMethod(
 "_assert_equals_",
 "_assert_equals_",
 smalltalk.method({
 smalltalk.method({
 selector: "assert:equals:",
 selector: "assert:equals:",
-fn: function (expected,actual){
-var self=this;
-var $1;
-$1=smalltalk.send(self,"_assert_description_",[smalltalk.send(expected,"__eq",[actual]),smalltalk.send(smalltalk.send(smalltalk.send("Expected: ","__comma",[smalltalk.send(expected,"_asString",[])]),"__comma",[" but was: "]),"__comma",[smalltalk.send(actual,"_asString",[])])]);
-return $1;
+fn: function (expected, actual) {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
@@ -41,10 +43,11 @@ smalltalk.addMethod(
 "_deny_",
 "_deny_",
 smalltalk.method({
 smalltalk.method({
 selector: "deny:",
 selector: "deny:",
-fn: function (aBoolean){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send(aBoolean,"_not",[])]);
-return self}
+fn: function (aBoolean) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -52,18 +55,11 @@ smalltalk.addMethod(
 "_performTestFor_",
 "_performTestFor_",
 smalltalk.method({
 smalltalk.method({
 selector: "performTestFor:",
 selector: "performTestFor:",
-fn: function (aResult){
-var self=this;
-smalltalk.send((function(){
-return smalltalk.send((function(){
-return smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
-}),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
-return smalltalk.send(aResult,"_addFailure_",[self]);
-})]);
-}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
-return smalltalk.send(aResult,"_addError_",[self]);
-})]);
-return self}
+fn: function (aResult) {
+    var self = this;
+    smalltalk.send(function () {return smalltalk.send(function () {return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}, "_on_do_", [smalltalk.TestFailure || TestFailure, function (ex) {return smalltalk.send(aResult, "_addFailure_", [self]);}]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {return smalltalk.send(aResult, "_addError_", [self]);}]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -71,13 +67,14 @@ smalltalk.addMethod(
 "_runCaseFor_",
 "_runCaseFor_",
 smalltalk.method({
 smalltalk.method({
 selector: "runCaseFor:",
 selector: "runCaseFor:",
-fn: function (aTestResult){
-var self=this;
-smalltalk.send(self,"_setUp",[]);
-smalltalk.send(aTestResult,"_increaseRuns",[]);
-smalltalk.send(self,"_performTestFor_",[aTestResult]);
-smalltalk.send(self,"_tearDown",[]);
-return self}
+fn: function (aTestResult) {
+    var self = this;
+    smalltalk.send(self, "_setUp", []);
+    smalltalk.send(aTestResult, "_increaseRuns", []);
+    smalltalk.send(self, "_performTestFor_", [aTestResult]);
+    smalltalk.send(self, "_tearDown", []);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -85,9 +82,9 @@ smalltalk.addMethod(
 "_selector",
 "_selector",
 smalltalk.method({
 smalltalk.method({
 selector: "selector",
 selector: "selector",
-fn: function (){
-var self=this;
-return self["@testSelector"];
+fn: function () {
+    var self = this;
+    return self['@testSelector'];
 }
 }
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
@@ -96,10 +93,11 @@ smalltalk.addMethod(
 "_setTestSelector_",
 "_setTestSelector_",
 smalltalk.method({
 smalltalk.method({
 selector: "setTestSelector:",
 selector: "setTestSelector:",
-fn: function (aSelector){
-var self=this;
-self["@testSelector"]=aSelector;
-return self}
+fn: function (aSelector) {
+    var self = this;
+    self['@testSelector'] = aSelector;
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -107,9 +105,10 @@ smalltalk.addMethod(
 "_setUp",
 "_setUp",
 smalltalk.method({
 smalltalk.method({
 selector: "setUp",
 selector: "setUp",
-fn: function (){
-var self=this;
-return self}
+fn: function () {
+    var self = this;
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -117,10 +116,11 @@ smalltalk.addMethod(
 "_should_",
 "_should_",
 smalltalk.method({
 smalltalk.method({
 selector: "should:",
 selector: "should:",
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send(aBlock,"_value",[])]);
-return self}
+fn: function (aBlock) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -128,15 +128,11 @@ smalltalk.addMethod(
 "_should_raise_",
 "_should_raise_",
 smalltalk.method({
 smalltalk.method({
 selector: "should:raise:",
 selector: "should:raise:",
-fn: function (aBlock,anExceptionClass){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
-smalltalk.send(aBlock,"_value",[]);
-return false;
-}),"_on_do_",[anExceptionClass,(function(ex){
-return true;
-})])]);
-return self}
+fn: function (aBlock, anExceptionClass) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return false;}, "_on_do_", [anExceptionClass, function (ex) {return true;}])]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -144,15 +140,11 @@ smalltalk.addMethod(
 "_shouldnt_raise_",
 "_shouldnt_raise_",
 smalltalk.method({
 smalltalk.method({
 selector: "shouldnt:raise:",
 selector: "shouldnt:raise:",
-fn: function (aBlock,anExceptionClass){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
-smalltalk.send(aBlock,"_value",[]);
-return true;
-}),"_on_do_",[anExceptionClass,(function(ex){
-return false;
-})])]);
-return self}
+fn: function (aBlock, anExceptionClass) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return true;}, "_on_do_", [anExceptionClass, function (ex) {return false;}])]);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -160,13 +152,14 @@ smalltalk.addMethod(
 "_signalFailure_",
 "_signalFailure_",
 smalltalk.method({
 smalltalk.method({
 selector: "signalFailure:",
 selector: "signalFailure:",
-fn: function (aString){
-var self=this;
-var $1,$2;
-$1=smalltalk.send((smalltalk.TestFailure || TestFailure),"_new",[]);
-smalltalk.send($1,"_messageText_",[aString]);
-$2=smalltalk.send($1,"_signal",[]);
-return self}
+fn: function (aString) {
+    var self = this;
+    var $1, $2;
+    $1 = smalltalk.send(smalltalk.TestFailure || TestFailure, "_new", []);
+    smalltalk.send($1, "_messageText_", [aString]);
+    $2 = smalltalk.send($1, "_signal", []);
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -174,9 +167,10 @@ smalltalk.addMethod(
 "_tearDown",
 "_tearDown",
 smalltalk.method({
 smalltalk.method({
 selector: "tearDown",
 selector: "tearDown",
-fn: function (){
-var self=this;
-return self}
+fn: function () {
+    var self = this;
+    return self;
+}
 }),
 }),
 smalltalk.TestCase);
 smalltalk.TestCase);
 
 
@@ -185,16 +179,16 @@ smalltalk.addMethod(
 "_allTestSelectors",
 "_allTestSelectors",
 smalltalk.method({
 smalltalk.method({
 selector: "allTestSelectors",
 selector: "allTestSelectors",
-fn: function (){
-var self=this;
-var $1;
-var selectors;
-selectors=smalltalk.send(self,"_testSelectors",[]);
-$1=smalltalk.send(self,"_shouldInheritSelectors",[]);
-if(smalltalk.assert($1)){
-smalltalk.send(selectors,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allTestSelectors",[])]);
-};
-return selectors;
+fn: function () {
+    var self = this;
+    var $1;
+    var selectors;
+    selectors = smalltalk.send(self, "_testSelectors", []);
+    $1 = smalltalk.send(self, "_shouldInheritSelectors", []);
+    if (smalltalk.assert($1)) {
+        smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);
+    }
+    return selectors;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -203,13 +197,11 @@ smalltalk.addMethod(
 "_buildSuite",
 "_buildSuite",
 smalltalk.method({
 smalltalk.method({
 selector: "buildSuite",
 selector: "buildSuite",
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(self,"_allTestSelectors",[]),"_collect_",[(function(each){
-return smalltalk.send(self,"_selector_",[each]);
-})]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [function (each) {return smalltalk.send(self, "_selector_", [each]);}]);
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -218,11 +210,11 @@ smalltalk.addMethod(
 "_isAbstract",
 "_isAbstract",
 smalltalk.method({
 smalltalk.method({
 selector: "isAbstract",
 selector: "isAbstract",
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(self,"_name",[]),"__eq",["TestCase"]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -231,9 +223,9 @@ smalltalk.addMethod(
 "_lookupHierarchyRoot",
 "_lookupHierarchyRoot",
 smalltalk.method({
 smalltalk.method({
 selector: "lookupHierarchyRoot",
 selector: "lookupHierarchyRoot",
-fn: function (){
-var self=this;
-return (smalltalk.TestCase || TestCase);
+fn: function () {
+    var self = this;
+    return smalltalk.TestCase || TestCase;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -242,14 +234,14 @@ smalltalk.addMethod(
 "_selector_",
 "_selector_",
 smalltalk.method({
 smalltalk.method({
 selector: "selector:",
 selector: "selector:",
-fn: function (aSelector){
-var self=this;
-var $2,$3,$1;
-$2=smalltalk.send(self,"_new",[]);
-smalltalk.send($2,"_setTestSelector_",[aSelector]);
-$3=smalltalk.send($2,"_yourself",[]);
-$1=$3;
-return $1;
+fn: function (aSelector) {
+    var self = this;
+    var $2, $3, $1;
+    $2 = smalltalk.send(self, "_new", []);
+    smalltalk.send($2, "_setTestSelector_", [aSelector]);
+    $3 = smalltalk.send($2, "_yourself", []);
+    $1 = $3;
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -258,11 +250,11 @@ smalltalk.addMethod(
 "_shouldInheritSelectors",
 "_shouldInheritSelectors",
 smalltalk.method({
 smalltalk.method({
 selector: "shouldInheritSelectors",
 selector: "shouldInheritSelectors",
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(self,"_~_eq",[smalltalk.send(self,"_lookupHierarchyRoot",[])]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -271,13 +263,11 @@ smalltalk.addMethod(
 "_testSelectors",
 "_testSelectors",
 smalltalk.method({
 smalltalk.method({
 selector: "testSelectors",
 selector: "testSelectors",
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]),"_select_",[(function(each){
-return smalltalk.send(each,"_match_",["^test"]);
-})]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [function (each) {return smalltalk.send(each, "_match_", ["^test"]);}]);
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestCase.klass);
 smalltalk.TestCase.klass);
@@ -291,10 +281,11 @@ smalltalk.addMethod(
 "_addError_",
 "_addError_",
 smalltalk.method({
 smalltalk.method({
 selector: "addError:",
 selector: "addError:",
-fn: function (anError){
-var self=this;
-smalltalk.send(smalltalk.send(self,"_errors",[]),"_add_",[anError]);
-return self}
+fn: function (anError) {
+    var self = this;
+    smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
+    return self;
+}
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
 
 
@@ -302,10 +293,11 @@ smalltalk.addMethod(
 "_addFailure_",
 "_addFailure_",
 smalltalk.method({
 smalltalk.method({
 selector: "addFailure:",
 selector: "addFailure:",
-fn: function (aFailure){
-var self=this;
-smalltalk.send(smalltalk.send(self,"_failures",[]),"_add_",[aFailure]);
-return self}
+fn: function (aFailure) {
+    var self = this;
+    smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
+    return self;
+}
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
 
 
@@ -313,9 +305,9 @@ smalltalk.addMethod(
 "_errors",
 "_errors",
 smalltalk.method({
 smalltalk.method({
 selector: "errors",
 selector: "errors",
-fn: function (){
-var self=this;
-return self["@errors"];
+fn: function () {
+    var self = this;
+    return self['@errors'];
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -324,9 +316,9 @@ smalltalk.addMethod(
 "_failures",
 "_failures",
 smalltalk.method({
 smalltalk.method({
 selector: "failures",
 selector: "failures",
-fn: function (){
-var self=this;
-return self["@failures"];
+fn: function () {
+    var self = this;
+    return self['@failures'];
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -335,10 +327,11 @@ smalltalk.addMethod(
 "_increaseRuns",
 "_increaseRuns",
 smalltalk.method({
 smalltalk.method({
 selector: "increaseRuns",
 selector: "increaseRuns",
-fn: function (){
-var self=this;
-self["@runs"]=smalltalk.send(self["@runs"],"__plus",[(1)]);
-return self}
+fn: function () {
+    var self = this;
+    self['@runs'] = smalltalk.send(self['@runs'], "__plus", [1]);
+    return self;
+}
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
 
 
@@ -346,15 +339,16 @@ smalltalk.addMethod(
 "_initialize",
 "_initialize",
 smalltalk.method({
 smalltalk.method({
 selector: "initialize",
 selector: "initialize",
-fn: function (){
-var self=this;
-smalltalk.send(self,"_initialize",[],smalltalk.Object);
-self["@timestamp"]=smalltalk.send((smalltalk.Date || Date),"_now",[]);
-self["@runs"]=(0);
-self["@errors"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-self["@failures"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-self["@total"]=(0);
-return self}
+fn: function () {
+    var self = this;
+    smalltalk.send(self, "_initialize", [], smalltalk.Object);
+    self['@timestamp'] = smalltalk.send(smalltalk.Date || Date, "_now", []);
+    self['@runs'] = 0;
+    self['@errors'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
+    self['@failures'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
+    self['@total'] = 0;
+    return self;
+}
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
 
 
@@ -362,9 +356,9 @@ smalltalk.addMethod(
 "_runs",
 "_runs",
 smalltalk.method({
 smalltalk.method({
 selector: "runs",
 selector: "runs",
-fn: function (){
-var self=this;
-return self["@runs"];
+fn: function () {
+    var self = this;
+    return self['@runs'];
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -373,21 +367,21 @@ smalltalk.addMethod(
 "_status",
 "_status",
 smalltalk.method({
 smalltalk.method({
 selector: "status",
 selector: "status",
-fn: function (){
-var self=this;
-var $2,$3,$1;
-$2=smalltalk.send(smalltalk.send(self,"_errors",[]),"_isEmpty",[]);
-if(smalltalk.assert($2)){
-$3=smalltalk.send(smalltalk.send(self,"_failures",[]),"_isEmpty",[]);
-if(smalltalk.assert($3)){
-$1="success";
-} else {
-$1="failure";
-};
-} else {
-$1="error";
-};
-return $1;
+fn: function () {
+    var self = this;
+    var $2, $3, $1;
+    $2 = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []);
+    if (smalltalk.assert($2)) {
+        $3 = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []);
+        if (smalltalk.assert($3)) {
+            $1 = "success";
+        } else {
+            $1 = "failure";
+        }
+    } else {
+        $1 = "error";
+    }
+    return $1;
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -396,9 +390,9 @@ smalltalk.addMethod(
 "_timestamp",
 "_timestamp",
 smalltalk.method({
 smalltalk.method({
 selector: "timestamp",
 selector: "timestamp",
-fn: function (){
-var self=this;
-return self["@timestamp"];
+fn: function () {
+    var self = this;
+    return self['@timestamp'];
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -407,9 +401,9 @@ smalltalk.addMethod(
 "_total",
 "_total",
 smalltalk.method({
 smalltalk.method({
 selector: "total",
 selector: "total",
-fn: function (){
-var self=this;
-return self["@total"];
+fn: function () {
+    var self = this;
+    return self['@total'];
 }
 }
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
@@ -418,10 +412,11 @@ smalltalk.addMethod(
 "_total_",
 "_total_",
 smalltalk.method({
 smalltalk.method({
 selector: "total:",
 selector: "total:",
-fn: function (aNumber){
-var self=this;
-self["@total"]=aNumber;
-return self}
+fn: function (aNumber) {
+    var self = this;
+    self['@total'] = aNumber;
+    return self;
+}
 }),
 }),
 smalltalk.TestResult);
 smalltalk.TestResult);
 
 

+ 175 - 180
js/SUnit.js

@@ -5,10 +5,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "assert:",
 selector: "assert:",
 category: 'testing',
 category: 'testing',
-fn: function (aBoolean){
-var self=this;
-smalltalk.send(self,"_assert_description_",[aBoolean,"Assertion failed"]);
-return self},
+fn: function (aBoolean) {
+    var self = this;
+    smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
+    return self;
+},
 args: ["aBoolean"],
 args: ["aBoolean"],
 source: "assert: aBoolean\x0a\x09self assert: aBoolean description: 'Assertion failed'",
 source: "assert: aBoolean\x0a\x09self assert: aBoolean description: 'Assertion failed'",
 messageSends: ["assert:description:"],
 messageSends: ["assert:description:"],
@@ -21,12 +22,13 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "assert:description:",
 selector: "assert:description:",
 category: 'testing',
 category: 'testing',
-fn: function (aBoolean,aString){
-var self=this;
-if(! smalltalk.assert(aBoolean)){
-smalltalk.send(self,"_signalFailure_",[aString]);
-};
-return self},
+fn: function (aBoolean, aString) {
+    var self = this;
+    if (!smalltalk.assert(aBoolean)) {
+        smalltalk.send(self, "_signalFailure_", [aString]);
+    }
+    return self;
+},
 args: ["aBoolean", "aString"],
 args: ["aBoolean", "aString"],
 source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [self signalFailure: aString]",
 source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [self signalFailure: aString]",
 messageSends: ["ifFalse:", "signalFailure:"],
 messageSends: ["ifFalse:", "signalFailure:"],
@@ -39,11 +41,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "assert:equals:",
 selector: "assert:equals:",
 category: 'testing',
 category: 'testing',
-fn: function (expected,actual){
-var self=this;
-var $1;
-$1=smalltalk.send(self,"_assert_description_",[smalltalk.send(expected,"__eq",[actual]),smalltalk.send(smalltalk.send(smalltalk.send("Expected: ","__comma",[smalltalk.send(expected,"_asString",[])]),"__comma",[" but was: "]),"__comma",[smalltalk.send(actual,"_asString",[])])]);
-return $1;
+fn: function (expected, actual) {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
+    return $1;
 },
 },
 args: ["expected", "actual"],
 args: ["expected", "actual"],
 source: "assert: expected equals: actual\x0a\x09^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString",
 source: "assert: expected equals: actual\x0a\x09^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString",
@@ -57,10 +59,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "deny:",
 selector: "deny:",
 category: 'testing',
 category: 'testing',
-fn: function (aBoolean){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send(aBoolean,"_not",[])]);
-return self},
+fn: function (aBoolean) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
+    return self;
+},
 args: ["aBoolean"],
 args: ["aBoolean"],
 source: "deny: aBoolean\x0a\x09self assert: aBoolean not",
 source: "deny: aBoolean\x0a\x09self assert: aBoolean not",
 messageSends: ["assert:", "not"],
 messageSends: ["assert:", "not"],
@@ -73,18 +76,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "performTestFor:",
 selector: "performTestFor:",
 category: 'running',
 category: 'running',
-fn: function (aResult){
-var self=this;
-smalltalk.send((function(){
-return smalltalk.send((function(){
-return smalltalk.send(self,"_perform_",[smalltalk.send(self,"_selector",[])]);
-}),"_on_do_",[(smalltalk.TestFailure || TestFailure),(function(ex){
-return smalltalk.send(aResult,"_addFailure_",[self]);
-})]);
-}),"_on_do_",[(smalltalk.Error || Error),(function(ex){
-return smalltalk.send(aResult,"_addError_",[self]);
-})]);
-return self},
+fn: function (aResult) {
+    var self = this;
+    smalltalk.send(function () {return smalltalk.send(function () {return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}, "_on_do_", [smalltalk.TestFailure || TestFailure, function (ex) {return smalltalk.send(aResult, "_addFailure_", [self]);}]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {return smalltalk.send(aResult, "_addError_", [self]);}]);
+    return self;
+},
 args: ["aResult"],
 args: ["aResult"],
 source: "performTestFor: aResult\x0a\x09[[self perform: self selector]\x0a\x09\x09on: TestFailure do: [:ex | aResult addFailure: self]]\x0a\x09\x09on: Error do: [:ex | aResult addError: self]",
 source: "performTestFor: aResult\x0a\x09[[self perform: self selector]\x0a\x09\x09on: TestFailure do: [:ex | aResult addFailure: self]]\x0a\x09\x09on: Error do: [:ex | aResult addError: self]",
 messageSends: ["on:do:", "addError:", "addFailure:", "perform:", "selector"],
 messageSends: ["on:do:", "addError:", "addFailure:", "perform:", "selector"],
@@ -97,13 +93,14 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "runCaseFor:",
 selector: "runCaseFor:",
 category: 'running',
 category: 'running',
-fn: function (aTestResult){
-var self=this;
-smalltalk.send(self,"_setUp",[]);
-smalltalk.send(aTestResult,"_increaseRuns",[]);
-smalltalk.send(self,"_performTestFor_",[aTestResult]);
-smalltalk.send(self,"_tearDown",[]);
-return self},
+fn: function (aTestResult) {
+    var self = this;
+    smalltalk.send(self, "_setUp", []);
+    smalltalk.send(aTestResult, "_increaseRuns", []);
+    smalltalk.send(self, "_performTestFor_", [aTestResult]);
+    smalltalk.send(self, "_tearDown", []);
+    return self;
+},
 args: ["aTestResult"],
 args: ["aTestResult"],
 source: "runCaseFor: aTestResult\x0a\x09self setUp.\x0a\x09aTestResult increaseRuns.\x0a\x09self performTestFor: aTestResult.\x0a\x09self tearDown",
 source: "runCaseFor: aTestResult\x0a\x09self setUp.\x0a\x09aTestResult increaseRuns.\x0a\x09self performTestFor: aTestResult.\x0a\x09self tearDown",
 messageSends: ["setUp", "increaseRuns", "performTestFor:", "tearDown"],
 messageSends: ["setUp", "increaseRuns", "performTestFor:", "tearDown"],
@@ -116,9 +113,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "selector",
 selector: "selector",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@testSelector"];
+fn: function () {
+    var self = this;
+    return self['@testSelector'];
 },
 },
 args: [],
 args: [],
 source: "selector\x0a\x09^testSelector",
 source: "selector\x0a\x09^testSelector",
@@ -132,10 +129,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "setTestSelector:",
 selector: "setTestSelector:",
 category: 'accessing',
 category: 'accessing',
-fn: function (aSelector){
-var self=this;
-self["@testSelector"]=aSelector;
-return self},
+fn: function (aSelector) {
+    var self = this;
+    self['@testSelector'] = aSelector;
+    return self;
+},
 args: ["aSelector"],
 args: ["aSelector"],
 source: "setTestSelector: aSelector\x0a\x09testSelector := aSelector",
 source: "setTestSelector: aSelector\x0a\x09testSelector := aSelector",
 messageSends: [],
 messageSends: [],
@@ -148,9 +146,10 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "setUp",
 selector: "setUp",
 category: 'running',
 category: 'running',
-fn: function (){
-var self=this;
-return self},
+fn: function () {
+    var self = this;
+    return self;
+},
 args: [],
 args: [],
 source: "setUp",
 source: "setUp",
 messageSends: [],
 messageSends: [],
@@ -163,10 +162,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "should:",
 selector: "should:",
 category: 'testing',
 category: 'testing',
-fn: function (aBlock){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send(aBlock,"_value",[])]);
-return self},
+fn: function (aBlock) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
+    return self;
+},
 args: ["aBlock"],
 args: ["aBlock"],
 source: "should: aBlock\x0a\x09self assert: aBlock value",
 source: "should: aBlock\x0a\x09self assert: aBlock value",
 messageSends: ["assert:", "value"],
 messageSends: ["assert:", "value"],
@@ -179,15 +179,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "should:raise:",
 selector: "should:raise:",
 category: 'testing',
 category: 'testing',
-fn: function (aBlock,anExceptionClass){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
-smalltalk.send(aBlock,"_value",[]);
-return false;
-}),"_on_do_",[anExceptionClass,(function(ex){
-return true;
-})])]);
-return self},
+fn: function (aBlock, anExceptionClass) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return false;}, "_on_do_", [anExceptionClass, function (ex) {return true;}])]);
+    return self;
+},
 args: ["aBlock", "anExceptionClass"],
 args: ["aBlock", "anExceptionClass"],
 source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. false] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | true])",
 source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. false] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | true])",
 messageSends: ["assert:", "on:do:", "value"],
 messageSends: ["assert:", "on:do:", "value"],
@@ -200,15 +196,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "shouldnt:raise:",
 selector: "shouldnt:raise:",
 category: 'testing',
 category: 'testing',
-fn: function (aBlock,anExceptionClass){
-var self=this;
-smalltalk.send(self,"_assert_",[smalltalk.send((function(){
-smalltalk.send(aBlock,"_value",[]);
-return true;
-}),"_on_do_",[anExceptionClass,(function(ex){
-return false;
-})])]);
-return self},
+fn: function (aBlock, anExceptionClass) {
+    var self = this;
+    smalltalk.send(self, "_assert_", [smalltalk.send(function () {smalltalk.send(aBlock, "_value", []);return true;}, "_on_do_", [anExceptionClass, function (ex) {return false;}])]);
+    return self;
+},
 args: ["aBlock", "anExceptionClass"],
 args: ["aBlock", "anExceptionClass"],
 source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. true] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | false])",
 source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. true] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | false])",
 messageSends: ["assert:", "on:do:", "value"],
 messageSends: ["assert:", "on:do:", "value"],
@@ -221,13 +213,14 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "signalFailure:",
 selector: "signalFailure:",
 category: 'private',
 category: 'private',
-fn: function (aString){
-var self=this;
-var $1,$2;
-$1=smalltalk.send((smalltalk.TestFailure || TestFailure),"_new",[]);
-smalltalk.send($1,"_messageText_",[aString]);
-$2=smalltalk.send($1,"_signal",[]);
-return self},
+fn: function (aString) {
+    var self = this;
+    var $1, $2;
+    $1 = smalltalk.send(smalltalk.TestFailure || TestFailure, "_new", []);
+    smalltalk.send($1, "_messageText_", [aString]);
+    $2 = smalltalk.send($1, "_signal", []);
+    return self;
+},
 args: ["aString"],
 args: ["aString"],
 source: "signalFailure: aString\x0a\x09TestFailure new\x0a\x09\x09messageText: aString;\x0a\x09\x09signal",
 source: "signalFailure: aString\x0a\x09TestFailure new\x0a\x09\x09messageText: aString;\x0a\x09\x09signal",
 messageSends: ["messageText:", "new", "signal"],
 messageSends: ["messageText:", "new", "signal"],
@@ -240,9 +233,10 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "tearDown",
 selector: "tearDown",
 category: 'running',
 category: 'running',
-fn: function (){
-var self=this;
-return self},
+fn: function () {
+    var self = this;
+    return self;
+},
 args: [],
 args: [],
 source: "tearDown",
 source: "tearDown",
 messageSends: [],
 messageSends: [],
@@ -256,16 +250,16 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "allTestSelectors",
 selector: "allTestSelectors",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-var $1;
-var selectors;
-selectors=smalltalk.send(self,"_testSelectors",[]);
-$1=smalltalk.send(self,"_shouldInheritSelectors",[]);
-if(smalltalk.assert($1)){
-smalltalk.send(selectors,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allTestSelectors",[])]);
-};
-return selectors;
+fn: function () {
+    var self = this;
+    var $1;
+    var selectors;
+    selectors = smalltalk.send(self, "_testSelectors", []);
+    $1 = smalltalk.send(self, "_shouldInheritSelectors", []);
+    if (smalltalk.assert($1)) {
+        smalltalk.send(selectors, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allTestSelectors", [])]);
+    }
+    return selectors;
 },
 },
 args: [],
 args: [],
 source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors].\x0a\x09^selectors",
 source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors].\x0a\x09^selectors",
@@ -279,13 +273,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "buildSuite",
 selector: "buildSuite",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(self,"_allTestSelectors",[]),"_collect_",[(function(each){
-return smalltalk.send(self,"_selector_",[each]);
-})]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [function (each) {return smalltalk.send(self, "_selector_", [each]);}]);
+    return $1;
 },
 },
 args: [],
 args: [],
 source: "buildSuite\x0a\x09^self allTestSelectors collect: [:each | self selector: each]",
 source: "buildSuite\x0a\x09^self allTestSelectors collect: [:each | self selector: each]",
@@ -299,11 +291,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "isAbstract",
 selector: "isAbstract",
 category: 'testing',
 category: 'testing',
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(self,"_name",[]),"__eq",["TestCase"]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
+    return $1;
 },
 },
 args: [],
 args: [],
 source: "isAbstract\x0a\x09^ self name = 'TestCase'",
 source: "isAbstract\x0a\x09^ self name = 'TestCase'",
@@ -317,9 +309,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "lookupHierarchyRoot",
 selector: "lookupHierarchyRoot",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return (smalltalk.TestCase || TestCase);
+fn: function () {
+    var self = this;
+    return smalltalk.TestCase || TestCase;
 },
 },
 args: [],
 args: [],
 source: "lookupHierarchyRoot\x0a\x09^TestCase",
 source: "lookupHierarchyRoot\x0a\x09^TestCase",
@@ -333,14 +325,14 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "selector:",
 selector: "selector:",
 category: 'accessing',
 category: 'accessing',
-fn: function (aSelector){
-var self=this;
-var $2,$3,$1;
-$2=smalltalk.send(self,"_new",[]);
-smalltalk.send($2,"_setTestSelector_",[aSelector]);
-$3=smalltalk.send($2,"_yourself",[]);
-$1=$3;
-return $1;
+fn: function (aSelector) {
+    var self = this;
+    var $2, $3, $1;
+    $2 = smalltalk.send(self, "_new", []);
+    smalltalk.send($2, "_setTestSelector_", [aSelector]);
+    $3 = smalltalk.send($2, "_yourself", []);
+    $1 = $3;
+    return $1;
 },
 },
 args: ["aSelector"],
 args: ["aSelector"],
 source: "selector: aSelector\x0a\x09^self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
 source: "selector: aSelector\x0a\x09^self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
@@ -354,11 +346,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "shouldInheritSelectors",
 selector: "shouldInheritSelectors",
 category: 'testing',
 category: 'testing',
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(self,"_~_eq",[smalltalk.send(self,"_lookupHierarchyRoot",[])]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
+    return $1;
 },
 },
 args: [],
 args: [],
 source: "shouldInheritSelectors\x0a\x09^self ~= self lookupHierarchyRoot",
 source: "shouldInheritSelectors\x0a\x09^self ~= self lookupHierarchyRoot",
@@ -372,13 +364,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "testSelectors",
 selector: "testSelectors",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-var $1;
-$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]),"_select_",[(function(each){
-return smalltalk.send(each,"_match_",["^test"]);
-})]);
-return $1;
+fn: function () {
+    var self = this;
+    var $1;
+    $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [function (each) {return smalltalk.send(each, "_match_", ["^test"]);}]);
+    return $1;
 },
 },
 args: [],
 args: [],
 source: "testSelectors\x0a\x09^self methodDictionary keys select: [:each | each match: '^test']",
 source: "testSelectors\x0a\x09^self methodDictionary keys select: [:each | each match: '^test']",
@@ -397,10 +387,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "addError:",
 selector: "addError:",
 category: 'accessing',
 category: 'accessing',
-fn: function (anError){
-var self=this;
-smalltalk.send(smalltalk.send(self,"_errors",[]),"_add_",[anError]);
-return self},
+fn: function (anError) {
+    var self = this;
+    smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
+    return self;
+},
 args: ["anError"],
 args: ["anError"],
 source: "addError: anError\x0a\x09self errors add: anError",
 source: "addError: anError\x0a\x09self errors add: anError",
 messageSends: ["add:", "errors"],
 messageSends: ["add:", "errors"],
@@ -413,10 +404,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "addFailure:",
 selector: "addFailure:",
 category: 'accessing',
 category: 'accessing',
-fn: function (aFailure){
-var self=this;
-smalltalk.send(smalltalk.send(self,"_failures",[]),"_add_",[aFailure]);
-return self},
+fn: function (aFailure) {
+    var self = this;
+    smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
+    return self;
+},
 args: ["aFailure"],
 args: ["aFailure"],
 source: "addFailure: aFailure\x0a\x09self failures add: aFailure",
 source: "addFailure: aFailure\x0a\x09self failures add: aFailure",
 messageSends: ["add:", "failures"],
 messageSends: ["add:", "failures"],
@@ -429,9 +421,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "errors",
 selector: "errors",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@errors"];
+fn: function () {
+    var self = this;
+    return self['@errors'];
 },
 },
 args: [],
 args: [],
 source: "errors\x0a\x09^errors",
 source: "errors\x0a\x09^errors",
@@ -445,9 +437,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "failures",
 selector: "failures",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@failures"];
+fn: function () {
+    var self = this;
+    return self['@failures'];
 },
 },
 args: [],
 args: [],
 source: "failures\x0a\x09^failures",
 source: "failures\x0a\x09^failures",
@@ -461,10 +453,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "increaseRuns",
 selector: "increaseRuns",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-self["@runs"]=smalltalk.send(self["@runs"],"__plus",[(1)]);
-return self},
+fn: function () {
+    var self = this;
+    self['@runs'] = smalltalk.send(self['@runs'], "__plus", [1]);
+    return self;
+},
 args: [],
 args: [],
 source: "increaseRuns\x0a\x09runs := runs + 1",
 source: "increaseRuns\x0a\x09runs := runs + 1",
 messageSends: ["+"],
 messageSends: ["+"],
@@ -477,15 +470,16 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "initialize",
 selector: "initialize",
 category: 'initialization',
 category: 'initialization',
-fn: function (){
-var self=this;
-smalltalk.send(self,"_initialize",[],smalltalk.Object);
-self["@timestamp"]=smalltalk.send((smalltalk.Date || Date),"_now",[]);
-self["@runs"]=(0);
-self["@errors"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-self["@failures"]=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-self["@total"]=(0);
-return self},
+fn: function () {
+    var self = this;
+    smalltalk.send(self, "_initialize", [], smalltalk.Object);
+    self['@timestamp'] = smalltalk.send(smalltalk.Date || Date, "_now", []);
+    self['@runs'] = 0;
+    self['@errors'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
+    self['@failures'] = smalltalk.send(smalltalk.Array || Array, "_new", []);
+    self['@total'] = 0;
+    return self;
+},
 args: [],
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09timestamp := Date now.\x0a\x09runs := 0.\x0a\x09errors := Array new.\x0a\x09failures := Array new.\x0a\x09total := 0",
 source: "initialize\x0a\x09super initialize.\x0a\x09timestamp := Date now.\x0a\x09runs := 0.\x0a\x09errors := Array new.\x0a\x09failures := Array new.\x0a\x09total := 0",
 messageSends: ["initialize", "now", "new"],
 messageSends: ["initialize", "now", "new"],
@@ -498,9 +492,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "runs",
 selector: "runs",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@runs"];
+fn: function () {
+    var self = this;
+    return self['@runs'];
 },
 },
 args: [],
 args: [],
 source: "runs\x0a\x09^runs",
 source: "runs\x0a\x09^runs",
@@ -514,21 +508,21 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "status",
 selector: "status",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-var $2,$3,$1;
-$2=smalltalk.send(smalltalk.send(self,"_errors",[]),"_isEmpty",[]);
-if(smalltalk.assert($2)){
-$3=smalltalk.send(smalltalk.send(self,"_failures",[]),"_isEmpty",[]);
-if(smalltalk.assert($3)){
-$1="success";
-} else {
-$1="failure";
-};
-} else {
-$1="error";
-};
-return $1;
+fn: function () {
+    var self = this;
+    var $2, $3, $1;
+    $2 = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", []);
+    if (smalltalk.assert($2)) {
+        $3 = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", []);
+        if (smalltalk.assert($3)) {
+            $1 = "success";
+        } else {
+            $1 = "failure";
+        }
+    } else {
+        $1 = "error";
+    }
+    return $1;
 },
 },
 args: [],
 args: [],
 source: "status\x0a\x09^self errors isEmpty \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty \x0a\x09\x09\x09\x09ifTrue: ['success']\x0a\x09\x09\x09\x09ifFalse: ['failure']]\x0a\x09\x09ifFalse: ['error']",
 source: "status\x0a\x09^self errors isEmpty \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty \x0a\x09\x09\x09\x09ifTrue: ['success']\x0a\x09\x09\x09\x09ifFalse: ['failure']]\x0a\x09\x09ifFalse: ['error']",
@@ -542,9 +536,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "timestamp",
 selector: "timestamp",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@timestamp"];
+fn: function () {
+    var self = this;
+    return self['@timestamp'];
 },
 },
 args: [],
 args: [],
 source: "timestamp\x0a\x09^timestamp",
 source: "timestamp\x0a\x09^timestamp",
@@ -558,9 +552,9 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "total",
 selector: "total",
 category: 'accessing',
 category: 'accessing',
-fn: function (){
-var self=this;
-return self["@total"];
+fn: function () {
+    var self = this;
+    return self['@total'];
 },
 },
 args: [],
 args: [],
 source: "total\x0a\x09^total",
 source: "total\x0a\x09^total",
@@ -574,10 +568,11 @@ smalltalk.addMethod(
 smalltalk.method({
 smalltalk.method({
 selector: "total:",
 selector: "total:",
 category: 'accessing',
 category: 'accessing',
-fn: function (aNumber){
-var self=this;
-self["@total"]=aNumber;
-return self},
+fn: function (aNumber) {
+    var self = this;
+    self['@total'] = aNumber;
+    return self;
+},
 args: ["aNumber"],
 args: ["aNumber"],
 source: "total: aNumber\x0a\x09total := aNumber",
 source: "total: aNumber\x0a\x09total := aNumber",
 messageSends: [],
 messageSends: [],

+ 5 - 8
st/Kernel-Tests.st

@@ -851,15 +851,12 @@ testPropertyThatReturnsEmptyString
 !
 !
 
 
 testYourself
 testYourself
-	|body|
-	body := 'body' asJQuery
-				addClass: 'amber';
-				yourself.
-
-	self assert: (body hasClass: 'amber').
+	| object |
+	object := self jsObject
+		d: 'test';
+		yourself.
 
 
-	body removeClass: 'amber'.
-	self deny: (body hasClass: 'amber').
+	self assert: object d equals: 'test'
 ! !
 ! !
 
 
 TestCase subclass: #NumberTest
 TestCase subclass: #NumberTest

+ 40 - 0
test/Test.deploy.js

@@ -0,0 +1,40 @@
+smalltalk.addPackage('Test', {});
+smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
+
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+fn: function () {
+    var self = this;
+    smalltalk.send(self, "_runTestSuite", []);
+    return self;
+}
+}),
+smalltalk.NodeTestRunner.klass);
+
+smalltalk.addMethod(
+"_runTestSuite",
+smalltalk.method({
+selector: "runTestSuite",
+fn: function () {
+    var self = this;
+    var $1, $2;
+    var result;
+    result = smalltalk.send(smalltalk.TestResult || TestResult, "_new", []);
+    smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.TestCase || TestCase, "_allSubclasses", []), "_select_", [function (each) {return smalltalk.send(smalltalk.send(each, "_isAbstract", []), "_not", []);}]), "_do_", [function (each) {return smalltalk.send(smalltalk.send(each, "_buildSuite", []), "_do_", [function (suite) {return smalltalk.send(suite, "_runCaseFor_", [result]);}]);}]);
+    smalltalk.send(console, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_runs", []), "_asString", []), "__comma", [" tests run, "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_size", []), "_asString", [])]), "__comma", [" failures, "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_size", []), "_asString", [])]), "__comma", [" errors."])]);
+    $1 = smalltalk.send(smalltalk.send(result, "_failures", []), "_isEmpty", []);
+    if (!smalltalk.assert($1)) {
+        smalltalk.send(self, "_throw_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_first", []), "_class", []), "_name", []), "__comma", [" >> "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_first", []), "_selector", [])]), "__comma", [" is failing!"])]);
+    }
+    $2 = smalltalk.send(smalltalk.send(result, "_errors", []), "_isEmpty", []);
+    if (!smalltalk.assert($2)) {
+        smalltalk.send(self, "_throw_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_first", []), "_class", []), "_name", []), "__comma", [" >> "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_first", []), "_selector", [])]), "__comma", [" has errors!"])]);
+    }
+    return self;
+}
+}),
+smalltalk.NodeTestRunner.klass);
+
+

+ 50 - 0
test/Test.js

@@ -0,0 +1,50 @@
+smalltalk.addPackage('Test', {});
+smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
+
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+category: 'not yet classified',
+fn: function () {
+    var self = this;
+    smalltalk.send(self, "_runTestSuite", []);
+    return self;
+},
+args: [],
+source: "initialize\x0a\x09self runTestSuite",
+messageSends: ["runTestSuite"],
+referencedClasses: []
+}),
+smalltalk.NodeTestRunner.klass);
+
+smalltalk.addMethod(
+"_runTestSuite",
+smalltalk.method({
+selector: "runTestSuite",
+category: 'not yet classified',
+fn: function () {
+    var self = this;
+    var $1, $2;
+    var result;
+    result = smalltalk.send(smalltalk.TestResult || TestResult, "_new", []);
+    smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.TestCase || TestCase, "_allSubclasses", []), "_select_", [function (each) {return smalltalk.send(smalltalk.send(each, "_isAbstract", []), "_not", []);}]), "_do_", [function (each) {return smalltalk.send(smalltalk.send(each, "_buildSuite", []), "_do_", [function (suite) {return smalltalk.send(suite, "_runCaseFor_", [result]);}]);}]);
+    smalltalk.send(console, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_runs", []), "_asString", []), "__comma", [" tests run, "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_size", []), "_asString", [])]), "__comma", [" failures, "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_size", []), "_asString", [])]), "__comma", [" errors."])]);
+    $1 = smalltalk.send(smalltalk.send(result, "_failures", []), "_isEmpty", []);
+    if (!smalltalk.assert($1)) {
+        smalltalk.send(self, "_throw_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_first", []), "_class", []), "_name", []), "__comma", [" >> "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_failures", []), "_first", []), "_selector", [])]), "__comma", [" is failing!"])]);
+    }
+    $2 = smalltalk.send(smalltalk.send(result, "_errors", []), "_isEmpty", []);
+    if (!smalltalk.assert($2)) {
+        smalltalk.send(self, "_throw_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_first", []), "_class", []), "_name", []), "__comma", [" >> "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(result, "_errors", []), "_first", []), "_selector", [])]), "__comma", [" has errors!"])]);
+    }
+    return self;
+},
+args: [],
+source: "runTestSuite\x0a\x09| result |\x0a\x09result := TestResult new.\x0a\x0a\x09((TestCase allSubclasses\x0a\x09\x09select: [ :each | each isAbstract not ])\x0a\x09\x09do: [ :each | each buildSuite do: [ :suite | suite runCaseFor: result ] ]).\x0a\x0a\x09console log: result runs asString, ' tests run, ', result failures size asString, ' failures, ', result errors size asString, ' errors.'.\x0a\x0a\x09result failures isEmpty ifFalse: [ \x0a\x09\x09self throw: result failures first class name, ' >> ', result failures first selector, ' is failing!' ].\x0a\x09result errors isEmpty ifFalse: [\x0a\x09\x09self throw: result errors first class name, ' >> ', result errors first selector, ' has errors!' ].",
+messageSends: ["new", "do:", "runCaseFor:", "buildSuite", "select:", "not", "isAbstract", "allSubclasses", "log:", ",", "asString", "size", "errors", "failures", "runs", "ifFalse:", "throw:", "selector", "first", "name", "class", "isEmpty"],
+referencedClasses: ["TestResult", "TestCase"]
+}),
+smalltalk.NodeTestRunner.klass);
+
+

+ 27 - 0
test/Test.st

@@ -0,0 +1,27 @@
+Smalltalk current createPackage: 'Test' properties: #{}!
+Object subclass: #NodeTestRunner
+	instanceVariableNames: ''
+	package: 'Test'!
+
+!NodeTestRunner class methodsFor: 'not yet classified'!
+
+initialize
+	self runTestSuite
+!
+
+runTestSuite
+	| result |
+	result := TestResult new.
+
+	((TestCase allSubclasses
+		select: [ :each | each isAbstract not ])
+		do: [ :each | each buildSuite do: [ :suite | suite runCaseFor: result ] ]).
+
+	console log: result runs asString, ' tests run, ', result failures size asString, ' failures, ', result errors size asString, ' errors.'.
+
+	result failures isEmpty ifFalse: [ 
+		self throw: result failures first class name, ' >> ', result failures first selector, ' is failing!!' ].
+	result errors isEmpty ifFalse: [
+		self throw: result errors first class name, ' >> ', result errors first selector, ' has errors!!' ].
+! !
+

+ 10 - 0
test/run_build.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+cd `dirname ${0}`/..
+
+
+# Create the build file
+cat js/boot.js js/Kernel-Announcements.js js/Kernel-Classes.js js/Kernel-Collections.js  js/Kernel-Exceptions.js js/Kernel-Methods.js js/Kernel-Objects.js js/Kernel-Transcript.js js/Compiler-AST.js js/Compiler-Core.js js/Compiler-Exceptions.js js/Compiler-IR.js js/Compiler-Inlining.js js/Compiler-Semantic.js js/SUnit.js js/Kernel-Tests.js js/Compiler-Tests.js test/Test.js js/parser.js js/init.js > test/run.js
+
+
+#run it!
+node test/run.js