Browse Source

Merge pull request #368 from mkroehnert/unittests

Fix order of TestCase>>assert:equals: arguments as well as the tests using this method
Nicolas Petton 12 years ago
parent
commit
b4909979ae
12 changed files with 714 additions and 737 deletions
  1. 2 2
      js/Compiler-Tests.deploy.js
  2. 5 5
      js/Compiler-Tests.js
  3. 227 243
      js/Kernel-Tests.deploy.js
  4. 241 257
      js/Kernel-Tests.js
  5. 10 10
      js/SUnit-Tests.deploy.js
  6. 19 19
      js/SUnit-Tests.js
  7. 3 3
      js/SUnit.deploy.js
  8. 5 5
      js/SUnit.js
  9. 2 2
      st/Compiler-Tests.st
  10. 188 179
      st/Kernel-Tests.st
  11. 10 10
      st/SUnit-Tests.st
  12. 2 2
      st/SUnit.st

+ 2 - 2
js/Compiler-Tests.deploy.js

@@ -872,8 +872,8 @@ var src,ast;
 return smalltalk.withContext(function($ctx1) { 
src="foo | a | a + 1. [ [ | b | b := a ] ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-_st(self)._assert_(_st(_st(_st(ast)._scope())._scopeLevel()).__eq((1)));
-_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope())._scopeLevel()).__eq((3)));
+_st(self)._assert_equals_(_st(_st(ast)._scope())._scopeLevel(),(1));
+_st(self)._assert_equals_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope())._scopeLevel(),(3));
 return self}, function($ctx1) {$ctx1.fill(self,"testScopeLevel",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
 }),
 smalltalk.SemanticAnalyzerTest);

+ 5 - 5
js/Compiler-Tests.js

@@ -427,7 +427,7 @@ _st(_st(self)._interpreter())._step();
 _st(self)._assert_equals_(_st(_st(self)._interpreter())._result(),(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testSimpleStepping",{}, smalltalk.ASTSteppingInterpreterTest)})},
 args: [],
-source: "testSimpleStepping\x0a\x09self interpret: 'foo 1'.\x0a    \x0a    \x22SequenceNode\x22\x0a    self interpreter step.\x0a    \x0a    self assert: self interpreter result isNil.\x0a    \x0a    \x22ValueNode\x22\x0a    self interpreter step.\x0a    \x0a    self assert: self interpreter result equals: 1\x0a    \x0a\x09",
+source: "testSimpleStepping\x0a\x09self interpret: 'foo 1'.\x0a    \x0a    \x22SequenceNode\x22\x0a    self interpreter step.\x0a    \x0a    self assert: self interpreter result isNil.\x0a    \x0a    \x22ValueNode\x22\x0a    self interpreter step.\x0a    \x0a    self assert: self interpreter result equals: 1",
 messageSends: ["interpret:", "step", "interpreter", "assert:", "isNil", "result", "assert:equals:"],
 referencedClasses: []
 }),
@@ -1173,12 +1173,12 @@ var src,ast;
 return smalltalk.withContext(function($ctx1) { 
src="foo | a | a + 1. [ [ | b | b := a ] ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-_st(self)._assert_(_st(_st(_st(ast)._scope())._scopeLevel()).__eq((1)));
-_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope())._scopeLevel()).__eq((3)));
+_st(self)._assert_equals_(_st(_st(ast)._scope())._scopeLevel(),(1));
+_st(self)._assert_equals_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope())._scopeLevel(),(3));
 return self}, function($ctx1) {$ctx1.fill(self,"testScopeLevel",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})},
 args: [],
-source: "testScopeLevel\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope scopeLevel = 1.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel = 3",
-messageSends: ["parse:", "visit:", "assert:", "=", "scopeLevel", "scope", "first", "nodes", "last"],
+source: "testScopeLevel\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope scopeLevel equals: 1.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel equals: 3",
+messageSends: ["parse:", "visit:", "assert:equals:", "scopeLevel", "scope", "first", "nodes", "last"],
 referencedClasses: []
 }),
 smalltalk.SemanticAnalyzerTest);

File diff suppressed because it is too large
+ 227 - 243
js/Kernel-Tests.deploy.js


File diff suppressed because it is too large
+ 241 - 257
js/Kernel-Tests.js


+ 10 - 10
js/SUnit-Tests.deploy.js

@@ -31,7 +31,7 @@ selector: "testGrow",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@empty"])._addAll_(_st((1))._to_((100)));
-_st(self)._assert_(_st(_st(self["@empty"])._size()).__eq((100)));
+_st(self)._assert_equals_(_st(self["@empty"])._size(),(100));
 return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{}, smalltalk.ExampleSetTest)})}
 }),
 smalltalk.ExampleSetTest);
@@ -70,10 +70,10 @@ smalltalk.method({
 selector: "testOccurrences",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._assert_(_st(_st(self["@empty"])._occurrencesOf_((0))).__eq((0)));
-_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
+return smalltalk.withContext(function($ctx1) { 
_st(self)._assert_equals_(_st(self["@empty"])._occurrencesOf_((0)),(0));
+_st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
 _st(self["@full"])._add_((5));
-_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
+_st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{}, smalltalk.ExampleSetTest)})}
 }),
 smalltalk.ExampleSetTest);
@@ -243,8 +243,8 @@ runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
 _st(self)._timeout_((200));
 result=_st(runner)._result();
 assertBlock=_st(self)._async_((function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(["fakeError"])._asSet(),_st(self)._selectorSetOf_(_st(result)._errors()));
-_st(self)._assert_equals_(_st(["fakeErrorFailingInTearDown", "fakeFailure"])._asSet(),_st(self)._selectorSetOf_(_st(result)._failures()));
+return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st(["fakeError"])._asSet());
+_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeErrorFailingInTearDown", "fakeFailure"])._asSet());
 return _st(self)._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(_st(runner)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
@@ -344,8 +344,8 @@ runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
 _st(self)._timeout_((200));
 result=_st(runner)._result();
 assertBlock=_st(self)._async_((function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st((smalltalk.Set || Set))._new(),_st(self)._selectorSetOf_(_st(result)._errors()));
-_st(self)._assert_equals_(_st(["fakeMultipleTimeoutFailing", "fakeTimeout"])._asSet(),_st(self)._selectorSetOf_(_st(result)._failures()));
+return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st((smalltalk.Set || Set))._new());
+_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeMultipleTimeoutFailing", "fakeTimeout"])._asSet());
 return _st(self)._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(_st(runner)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
@@ -376,7 +376,7 @@ self["@flag"]="ok";
 self["@flag"];
 x=_st(x).__plus((1));
 x;
-return _st(self)._assert_equals_((1),x);
+return _st(self)._assert_equals_(x,(1));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
 self["@flag"]=_st(_st(self)._async_((function(){
 return smalltalk.withContext(function($ctx2) {
_st(self)._finished();
@@ -384,7 +384,7 @@ self["@flag"]="ok";
 self["@flag"];
 x=_st(x).__plus((1));
 x;
-return _st(self)._assert_equals_((1),x);
+return _st(self)._assert_equals_(x,(1));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
 return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x}, smalltalk.SUnitAsyncTest)})}
 }),

+ 19 - 19
js/SUnit-Tests.js

@@ -43,11 +43,11 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@empty"])._addAll_(_st((1))._to_((100)));
-_st(self)._assert_(_st(_st(self["@empty"])._size()).__eq((100)));
+_st(self)._assert_equals_(_st(self["@empty"])._size(),(100));
 return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{}, smalltalk.ExampleSetTest)})},
 args: [],
-source: "testGrow\x0a\x09empty addAll: (1 to: 100).\x0a\x09self assert: empty size = 100",
-messageSends: ["addAll:", "to:", "assert:", "=", "size"],
+source: "testGrow\x0a\x09empty addAll: (1 to: 100).\x0a\x09self assert: empty size equals: 100",
+messageSends: ["addAll:", "to:", "assert:equals:", "size"],
 referencedClasses: []
 }),
 smalltalk.ExampleSetTest);
@@ -97,14 +97,14 @@ selector: "testOccurrences",
 category: 'tests',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._assert_(_st(_st(self["@empty"])._occurrencesOf_((0))).__eq((0)));
-_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
+return smalltalk.withContext(function($ctx1) { 
_st(self)._assert_equals_(_st(self["@empty"])._occurrencesOf_((0)),(0));
+_st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
 _st(self["@full"])._add_((5));
-_st(self)._assert_(_st(_st(self["@full"])._occurrencesOf_((5))).__eq((1)));
+_st(self)._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{}, smalltalk.ExampleSetTest)})},
 args: [],
-source: "testOccurrences\x0a\x09self assert: (empty occurrencesOf: 0) = 0.\x0a\x09self assert: (full occurrencesOf: 5) = 1.\x0a\x09full add: 5.\x0a\x09self assert: (full occurrencesOf: 5) = 1",
-messageSends: ["assert:", "=", "occurrencesOf:", "add:"],
+source: "testOccurrences\x0a\x09self assert: (empty occurrencesOf: 0) equals: 0.\x0a\x09self assert: (full occurrencesOf: 5) equals: 1.\x0a\x09full add: 5.\x0a\x09self assert: (full occurrencesOf: 5) equals: 1",
+messageSends: ["assert:equals:", "occurrencesOf:", "add:"],
 referencedClasses: []
 }),
 smalltalk.ExampleSetTest);
@@ -325,8 +325,8 @@ runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
 _st(self)._timeout_((200));
 result=_st(runner)._result();
 assertBlock=_st(self)._async_((function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(["fakeError"])._asSet(),_st(self)._selectorSetOf_(_st(result)._errors()));
-_st(self)._assert_equals_(_st(["fakeErrorFailingInTearDown", "fakeFailure"])._asSet(),_st(self)._selectorSetOf_(_st(result)._failures()));
+return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st(["fakeError"])._asSet());
+_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeErrorFailingInTearDown", "fakeFailure"])._asSet());
 return _st(self)._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(_st(runner)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
@@ -339,8 +339,8 @@ return _st($2)._ifTrue_(assertBlock);
 _st(runner)._run();
 return self}, function($ctx1) {$ctx1.fill(self,"testAsyncErrorsAndFailures",{suite:suite,runner:runner,result:result,assertBlock:assertBlock}, smalltalk.SUnitAsyncTest)})},
 args: [],
-source: "testAsyncErrorsAndFailures\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeError' 'fakeErrorFailingInTearDown' 'fakeFailure' 'testPass') collect: [ :each | self class selector: each ].\x0a    runner := TestSuiteRunner on: suite.\x0a    self timeout: 200.\x0a\x09result := runner result.\x0a    assertBlock := self async: [\x0a\x09\x09self assert: #('fakeError') asSet equals: (self selectorSetOf: result errors).\x0a\x09\x09self assert: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet equals: (self selectorSetOf: result failures).\x0a\x09\x09self finished\x0a  \x09].\x0a    runner announcer on: ResultAnnouncement do: [:ann |\x0a    \x09ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].\x0a\x09runner run",
-messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "asSet", "selectorSetOf:", "errors", "failures", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"],
+source: "testAsyncErrorsAndFailures\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeError' 'fakeErrorFailingInTearDown' 'fakeFailure' 'testPass') collect: [ :each | self class selector: each ].\x0a    runner := TestSuiteRunner on: suite.\x0a    self timeout: 200.\x0a\x09result := runner result.\x0a    assertBlock := self async: [\x0a\x09\x09self assert: (self selectorSetOf: result errors) equals: #('fakeError') asSet.\x0a\x09\x09self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.\x0a\x09\x09self finished\x0a  \x09].\x0a    runner announcer on: ResultAnnouncement do: [:ann |\x0a    \x09ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].\x0a\x09runner run",
+messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "asSet", "failures", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"],
 referencedClasses: ["TestSuiteRunner", "ResultAnnouncement"]
 }),
 smalltalk.SUnitAsyncTest);
@@ -451,8 +451,8 @@ runner=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(suite);
 _st(self)._timeout_((200));
 result=_st(runner)._result();
 assertBlock=_st(self)._async_((function(){
-return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st((smalltalk.Set || Set))._new(),_st(self)._selectorSetOf_(_st(result)._errors()));
-_st(self)._assert_equals_(_st(["fakeMultipleTimeoutFailing", "fakeTimeout"])._asSet(),_st(self)._selectorSetOf_(_st(result)._failures()));
+return smalltalk.withContext(function($ctx2) {
_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._errors()),_st((smalltalk.Set || Set))._new());
+_st(self)._assert_equals_(_st(self)._selectorSetOf_(_st(result)._failures()),_st(["fakeMultipleTimeoutFailing", "fakeTimeout"])._asSet());
 return _st(self)._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(_st(runner)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
@@ -465,8 +465,8 @@ return _st($2)._ifTrue_(assertBlock);
 _st(runner)._run();
 return self}, function($ctx1) {$ctx1.fill(self,"testTimeouts",{suite:suite,runner:runner,result:result,assertBlock:assertBlock}, smalltalk.SUnitAsyncTest)})},
 args: [],
-source: "testTimeouts\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeTimeout' 'fakeMultipleTimeoutFailing' 'fakeMultipleTimeoutPassing' 'testPass') collect: [ :each | self class selector: each ].\x0a    runner := TestSuiteRunner on: suite.\x0a    self timeout: 200.\x0a\x09result := runner result.\x0a    assertBlock := self async: [\x0a\x09\x09self assert: Set new equals: (self selectorSetOf: result errors).\x0a\x09\x09self assert: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet equals: (self selectorSetOf: result failures).\x0a\x09\x09self finished\x0a  \x09].\x0a    runner announcer on: ResultAnnouncement do: [:ann |\x0a    \x09ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].\x0a\x09runner run",
-messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "new", "selectorSetOf:", "errors", "asSet", "failures", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"],
+source: "testTimeouts\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeTimeout' 'fakeMultipleTimeoutFailing' 'fakeMultipleTimeoutPassing' 'testPass') collect: [ :each | self class selector: each ].\x0a    runner := TestSuiteRunner on: suite.\x0a    self timeout: 200.\x0a\x09result := runner result.\x0a    assertBlock := self async: [\x0a\x09\x09self assert: (self selectorSetOf: result errors) equals: Set new.\x0a\x09\x09self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.\x0a\x09\x09self finished\x0a  \x09].\x0a    runner announcer on: ResultAnnouncement do: [:ann |\x0a    \x09ann result == result  ifTrue: [ result runs = result total ifTrue: assertBlock ]].\x0a\x09runner run",
+messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "new", "failures", "asSet", "finished", "on:do:", "ifTrue:", "=", "total", "runs", "==", "announcer", "run"],
 referencedClasses: ["TestSuiteRunner", "Set", "ResultAnnouncement"]
 }),
 smalltalk.SUnitAsyncTest);
@@ -488,7 +488,7 @@ self["@flag"]="ok";
 self["@flag"];
 x=_st(x).__plus((1));
 x;
-return _st(self)._assert_equals_((1),x);
+return _st(self)._assert_equals_(x,(1));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
 self["@flag"]=_st(_st(self)._async_((function(){
 return smalltalk.withContext(function($ctx2) {
_st(self)._finished();
@@ -496,11 +496,11 @@ self["@flag"]="ok";
 self["@flag"];
 x=_st(x).__plus((1));
 x;
-return _st(self)._assert_equals_((1),x);
+return _st(self)._assert_equals_(x,(1));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._valueWithTimeout_((0));
 return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x}, smalltalk.SUnitAsyncTest)})},
 args: [],
-source: "testTwoAsyncPassesWithFinishedOnlyOneIsRun\x0a\x09| x |\x0a\x09flag := 'bad'.\x0a\x09self timeout: 10.\x0a    x := 0.\x0a    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: 1 equals: x ]) valueWithTimeout: 0.\x0a    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: 1 equals: x ]) valueWithTimeout: 0.",
+source: "testTwoAsyncPassesWithFinishedOnlyOneIsRun\x0a\x09| x |\x0a\x09flag := 'bad'.\x0a\x09self timeout: 10.\x0a    x := 0.\x0a    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.\x0a    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished", "+", "assert:equals:"],
 referencedClasses: []
 }),

+ 3 - 3
js/SUnit.deploy.js

@@ -57,12 +57,12 @@ smalltalk.addMethod(
 "_assert_equals_",
 smalltalk.method({
 selector: "assert:equals:",
-fn: function (expected,actual){
+fn: function (actual,expected){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(self)._assert_description_(_st(expected).__eq(actual),_st(_st(_st("Expected: ").__comma(_st(expected)._asString())).__comma(" but was: ")).__comma(_st(actual)._asString()));
+$1=_st(self)._assert_description_(_st(actual).__eq(expected),_st(_st(_st("Expected: ").__comma(_st(expected)._asString())).__comma(" but was: ")).__comma(_st(actual)._asString()));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"assert:equals:",{expected:expected,actual:actual}, smalltalk.TestCase)})}
+}, function($ctx1) {$ctx1.fill(self,"assert:equals:",{actual:actual,expected:expected}, smalltalk.TestCase)})}
 }),
 smalltalk.TestCase);
 

+ 5 - 5
js/SUnit.js

@@ -79,14 +79,14 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:equals:",
 category: 'testing',
-fn: function (expected,actual){
+fn: function (actual,expected){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(self)._assert_description_(_st(expected).__eq(actual),_st(_st(_st("Expected: ").__comma(_st(expected)._asString())).__comma(" but was: ")).__comma(_st(actual)._asString()));
+$1=_st(self)._assert_description_(_st(actual).__eq(expected),_st(_st(_st("Expected: ").__comma(_st(expected)._asString())).__comma(" but was: ")).__comma(_st(actual)._asString()));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"assert:equals:",{expected:expected,actual:actual}, smalltalk.TestCase)})},
-args: ["expected", "actual"],
-source: "assert: expected equals: actual\x0a\x09^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString",
+}, function($ctx1) {$ctx1.fill(self,"assert:equals:",{actual:actual,expected:expected}, smalltalk.TestCase)})},
+args: ["actual", "expected"],
+source: "assert: actual equals: expected\x0a\x09^ self assert: (actual = expected) description: 'Expected: ', expected asString, ' but was: ', actual asString",
 messageSends: ["assert:description:", "=", ",", "asString"],
 referencedClasses: []
 }),

+ 2 - 2
st/Compiler-Tests.st

@@ -547,8 +547,8 @@ testScopeLevel
 	ast := smalltalk parse: src.
 	analyzer visit: ast.
 
-	self assert: ast scope scopeLevel = 1.
-	self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel = 3
+	self assert: ast scope scopeLevel equals: 1.
+	self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel equals: 3
 !
 
 testUnknownVariables

+ 188 - 179
st/Kernel-Tests.st

@@ -22,12 +22,12 @@ testCurrySelf
     curriedMethod := [ :selfarg :x | selfarg at: x ] currySelf asCompiledMethod: 'foo:'.
     array := #(3 1 4).
     ClassBuilder new installMethod: curriedMethod forClass: Array category: '**test helper'.
-    [ self assert: 1 equals: (array foo: 2) ]
+    [ self assert: (array foo: 2) equals: 1 ]
     ensure: [ Array removeCompiledMethod: curriedMethod ]
 !
 
 testEnsure
-	self assert: 3 equals: ([3] ensure: [4])
+	self assert: ([3] ensure: [4]) equals: 3
 !
 
 testEnsureRaises
@@ -110,14 +110,14 @@ testEquality
 	self deny: '' = false.
 	self deny: false = ''.
 
-	self assert: true = true.
+	self assert: (true = true).
 	self deny: false = true.
 	self deny: true = false.
-	self assert: false = false.
+	self assert: (false = false).
 
 	"JS may do some type coercing after sending a message"
-	self assert: true yourself = true.
-	self assert: true yourself = true yourself
+	self assert: (true yourself = true).
+	self assert: (true yourself = true yourself)
 !
 
 testIdentity
@@ -140,46 +140,54 @@ testIdentity
 
 testIfTrueIfFalse
  
-	self assert: (true ifTrue: ['alternative block']) = 'alternative block'.
-	self assert: (true ifFalse: ['alternative block']) = nil.
+	self assert: (true ifTrue: ['alternative block']) equals: 'alternative block'.
+	self assert: (true ifFalse: ['alternative block']) equals: nil.
 
-	self assert: (false ifTrue: ['alternative block']) = nil.
-	self assert: (false ifFalse: ['alternative block']) = 'alternative block'.
+	self assert: (false ifTrue: ['alternative block']) equals: nil.
+	self assert: (false ifFalse: ['alternative block']) equals: 'alternative block'.
 
-	self assert: (false ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block2'.
-	self assert: (false ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block'.
+	self assert: (false ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block2'.
+	self assert: (false ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block'.
 
-	self assert: (true ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block'.
-	self assert: (true ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block2'.
+	self assert: (true ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block'.
+	self assert: (true ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block2'.
 !
 
 testIfTrueIfFalseWithBoxing
  
-	self assert: (true yourself ifTrue: ['alternative block']) = 'alternative block'.
-	self assert: (true yourself ifFalse: ['alternative block']) = nil.
+	self assert: (true yourself ifTrue: ['alternative block']) equals: 'alternative block'.
+	self assert: (true yourself ifFalse: ['alternative block']) equals: nil.
 
-	self assert: (false yourself ifTrue: ['alternative block']) = nil.
-	self assert: (false yourself ifFalse: ['alternative block']) = 'alternative block'.
+	self assert: (false yourself ifTrue: ['alternative block']) equals: nil.
+	self assert: (false yourself ifFalse: ['alternative block']) equals: 'alternative block'.
 
-	self assert: (false yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block2'.
-	self assert: (false yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block'.
+	self assert: (false yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block2'.
+	self assert: (false yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block'.
 
-	self assert: (true yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) = 'alternative block'.
-	self assert: (true yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) = 'alternative block2'.
+	self assert: (true yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block'.
+	self assert: (true yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block2'.
 !
 
 testLogic
- 
 	"Trivial logic table"
-	self assert: (true & true); deny: (true & false); deny: (false & true); deny: (false & false).
-	self assert: (true | true); assert: (true | false); assert: (false | true); deny: (false | false).
-        "Checking that expressions work fine too"
-	self assert: (true & (1 > 0)); deny: ((1 > 0) & false); deny: ((1 > 0) & (1 > 2)).
-        self assert: (false | (1 > 0)); assert: ((1 > 0) | false); assert: ((1 > 0) | (1 > 2))
+	self assert: (true & true);
+    	deny: (true & false);
+        deny: (false & true);
+        deny: (false & false).
+	self assert: (true | true);
+    	assert: (true | false);
+        assert: (false | true);
+        deny: (false | false).
+	"Checking that expressions work fine too"
+	self assert: (true & (1 > 0));
+    	deny: ((1 > 0) & false);
+        deny: ((1 > 0) & (1 > 2)).
+	self assert: (false | (1 > 0));
+    	assert: ((1 > 0) | false);
+        assert: ((1 > 0) | (1 > 2))
 !
 
 testLogicKeywords
- 
 	"Trivial logic table"
 	self 
 		assert: (true and: [ true]); 
@@ -197,7 +205,7 @@ testLogicKeywords
 		assert: (true and: [ 1 > 0 ]); 
 		deny: ((1 > 0) and: [ false ]); 
 		deny: ((1 > 0) and: [ 1 > 2 ]).
-        self 
+	self 
 		assert: (false or: [ 1 > 0 ]); 
 		assert: ((1 > 0) or: [ false ]); 
 		assert: ((1 > 0) or: [ 1 > 2 ])
@@ -219,7 +227,9 @@ setUp
 
 tearDown
 	theClass ifNotNil: [Smalltalk current removeClass: theClass. theClass := nil]
-!
+! !
+
+!ClassBuilderTest methodsFor: 'tests'!
 
 testClassCopy
 	theClass := builder copyClass: ObjectMock named: 'ObjectMock2'.
@@ -318,10 +328,10 @@ defaultValues
 
 !CollectionTest methodsFor: 'convenience'!
 
-assertSameContents: aCollection 	as: anotherCollection
-	self assert: aCollection size = anotherCollection size.
+assertSameContents: aCollection as: anotherCollection
+	self assert: (aCollection size = anotherCollection size).
 	aCollection do: [ :each |
-		self assert: (aCollection occurrencesOf: each) = (anotherCollection occurrencesOf: each) ]
+		self assert: ((aCollection occurrencesOf: each) = (anotherCollection occurrencesOf: each)) ]
 ! !
 
 !CollectionTest methodsFor: 'testing'!
@@ -348,7 +358,7 @@ testAsSet
 	| c set |
 	c := self collectionWithDuplicates.
 	set := c asSet.
-	self assert: set size = 5.
+	self assert: set size equals: 5.
 	c do: [ :each |
 		self assert: (set includes: each) ]
 !
@@ -363,7 +373,7 @@ testCollect
 !
 
 testDetect
-	self assert: (self collection detect: [ :each | each < 0 ]) = -4.
+	self assert: (self collection detect: [ :each | each < 0 ]) equals: -4.
 	self 
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		raise: Error
@@ -394,8 +404,8 @@ testSelect
 !
 
 testSize
-	self assert: self collectionClass new size = 0.
-	self assert: self collection size = 4
+	self assert: self collectionClass new size equals: 0.
+	self assert: self collection size equals: 4
 ! !
 
 !CollectionTest class methodsFor: 'accessing'!
@@ -465,29 +475,29 @@ testAccessing
 	d := Dictionary new.
 
 	d at: 'hello' put: 'world'.
-	self assert: (d at: 'hello') = 'world'.
-	self assert: (d at: 'hello' ifAbsent: [nil]) = 'world'.
+	self assert: (d at: 'hello') equals: 'world'.
+	self assert: (d at: 'hello' ifAbsent: [nil]) equals: 'world'.
 	self deny: (d at: 'foo' ifAbsent: [nil]) = 'world'.
 
 	d at: 1 put: 2.
-	self assert: (d at: 1) = 2.
+	self assert: (d at: 1) equals: 2.
 
 	d at: 1@3 put: 3.
-	self assert: (d at: 1@3) = 3
+	self assert: (d at: 1@3) equals: 3
 !
 
 testDynamicDictionaries
-	self assert: #{'hello' -> 1} asDictionary = (Dictionary with: 'hello' -> 1)
+	self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)
 !
 
 testEquality
 	| d1 d2 |
 
-	self assert: Dictionary new = Dictionary new.
+	self assert: (Dictionary new = Dictionary new).
 		
 	d1 := Dictionary new at: 1 put: 2; yourself.
 	d2 := Dictionary new at: 1 put: 2; yourself.
-	self assert: d1 = d2.
+	self assert: (d1 = d2).
 
 	d2 := Dictionary new at: 1 put: 3; yourself.
 	self deny: d1 = d2.
@@ -517,7 +527,7 @@ testIfPresent
 	d at: 'hello' put: 'world'.
 
 	d at: 'hello' ifPresent: [ :value | visited := value ].
-	self assert: visited = 'world'.
+	self assert: visited equals: 'world'.
 
 	absent := d at: 'bye' ifPresent: [ :value | visited := value ].
 	self assert: absent isNil.
@@ -531,7 +541,7 @@ testIfPresentIfAbsent
 	d at: 'hello' put: 'world'.
 
 	d at: 'hello' ifPresent: [ :value | visited := value ] ifAbsent: [ visited := true ].
-	self assert: visited = 'world'.
+	self assert: visited equals: 'world'.
 
 	d at: 'buy' ifPresent: [ :value | visited := value ] ifAbsent: [ visited := true ].
 	self assert: visited.
@@ -545,16 +555,16 @@ testKeys
 	d at: 2 put: 3.
 	d at: 3 put: 4.
 
-	self assert: d keys = #(1 2 3)
+	self assert: d keys equals: #(1 2 3)
 !
 
 testPrintString
 	self
-		assert: 'a Dictionary(''firstname''->''James'' , ''lastname''->''Bond'')' 
-		equals: (Dictionary new 
+		assert: (Dictionary new 
                          	at:'firstname' put: 'James';
                         	at:'lastname' put: 'Bond';
                         	printString)
+		equals: 'a Dictionary(''firstname''->''James'' , ''lastname''->''Bond'')'
 !
 
 testRemoveKey
@@ -567,11 +577,11 @@ testRemoveKey
 
     key := 2.
 
-    self assert: d keys = #(1 2 3).
+    self assert: d keys equals: #(1 2 3).
 
     d removeKey: key.
-    self assert: d keys = #(1 3).
-    self assert: d values = #(2 4).
+    self assert: d keys equals: #(1 3).
+    self assert: d values equals: #(2 4).
     self deny: (d includesKey: 2)
 !
 
@@ -584,26 +594,26 @@ testRemoveKeyIfAbsent
     d at: 3 put: 4.
 
     key := 2.
-    self assert: (d removeKey: key) = 3.
+    self assert: (d removeKey: key) equals: 3.
 
     key := 3.
-    self assert: (d removeKey: key ifAbsent: [42]) = 4.
+    self assert: (d removeKey: key ifAbsent: [42]) equals: 4.
 
     key := 'why'.
-    self assert: (d removeKey: key ifAbsent: [42] ) = 42.
+    self assert: (d removeKey: key ifAbsent: [42] ) equals: 42.
 !
 
 testSize
 	| d |
 
 	d := Dictionary new.
-	self assert: d size = 0.
+	self assert: d size equals: 0.
 
 	d at: 1 put: 2.
-	self assert: d size = 1.
+	self assert: d size equals: 1.
 
 	d at: 2 put: 3.
-	self assert: d size = 2.
+	self assert: d size equals: 2.
 !
 
 testValues
@@ -614,7 +624,7 @@ testValues
 	d at: 2 put: 3.
 	d at: 3 put: 4.
 
-	self assert: d values = #(2 3 4)
+	self assert: d values equals: #(2 3 4)
 ! !
 
 !DictionaryTest class methodsFor: 'accessing'!
@@ -630,19 +640,19 @@ CollectionTest subclass: #SequenceableCollectionTest
 !SequenceableCollectionTest methodsFor: 'tests'!
 
 testAt
-	self assert: (self collection at: 4) = -4.
+	self assert: (self collection at: 4) equals: -4.
 	self should: [ self collection at: 5 ] raise: Error
 !
 
 testAtIfAbsent
-	self assert: (self collection at: (self collection size + 1) ifAbsent: [ 'none' ]) = 'none'
+	self assert: (self collection at: (self collection size + 1) ifAbsent: [ 'none' ]) equals: 'none'
 ! !
 
 SequenceableCollectionTest subclass: #ArrayTest
 	instanceVariableNames: ''
 	package: 'Kernel-Tests'!
 
-!ArrayTest methodsFor: 'testing'!
+!ArrayTest methodsFor: 'tests'!
 
 testAtIfAbsent
 	| array |
@@ -656,27 +666,27 @@ testAtIfAbsent
 !
 
 testFirstN
-	self assert: {1. 2. 3} equals: ({1. 2. 3. 4. 5} first: 3).
+	self assert: ({1. 2. 3. 4. 5} first: 3) equals: {1. 2. 3}
 !
 
 testIfEmpty
-	self assert: 'zork' equals: ( '' ifEmpty: ['zork'] )
+	self assert: ( '' ifEmpty: ['zork'] ) equals: 'zork'
 !
 
 testPrintString
 	| array |
 	array := Array new.
-	self assert: 'a Array ()' equals: ( array printString ).
+	self assert: array printString equals: 'a Array ()'.
 	array add: 1; add: 3.
-	self assert: 'a Array (1 3)' equals: ( array printString ).
+	self assert: array printString equals: 'a Array (1 3)'.
 	array add: 'foo'.
-	self assert: 'a Array (1 3 ''foo'')' equals: ( array printString ).
+	self assert: array printString equals: 'a Array (1 3 ''foo'')'.
 	array remove: 1; remove: 3.
-	self assert: 'a Array (''foo'')' equals: ( array printString ).
+	self assert: array printString equals: 'a Array (''foo'')'.
 	array addLast: 3.
-	self assert: 'a Array (''foo'' 3)' equals: ( array printString ).
+	self assert: array printString equals: 'a Array (''foo'' 3)'.
 	array addLast: 3.
-	self assert: 'a Array (''foo'' 3 3)' equals: ( array printString ).
+	self assert: array printString equals: 'a Array (''foo'' 3 3)'.
 ! !
 
 !ArrayTest class methodsFor: 'accessing'!
@@ -707,13 +717,13 @@ testAddRemove
 !
 
 testAsArray
-	self assert: 'hello' asArray = #('h' 'e' 'l' 'l' 'o').
+	self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').
 !
 
 testAt
-	self assert: ('hello' at: 1) = 'h'.
-	self assert: ('hello' at: 5) = 'o'.
-	self assert: ('hello' at: 6 ifAbsent: [nil]) = nil
+	self assert: ('hello' at: 1) equals: 'h'.
+	self assert: ('hello' at: 5) equals: 'o'.
+	self assert: ('hello' at: 6 ifAbsent: [nil]) equals: nil
 !
 
 testAtPut
@@ -732,23 +742,23 @@ testCollect
 
 testCopyWithoutAll
 	self 
-		assert: 'hello world' 
-		equals: ('*hello* *world*' copyWithoutAll: '*')
+		assert: ('*hello* *world*' copyWithoutAll: '*')
+        equals: 'hello world'
 !
 
 testDetect
-	self assert: (self collection detect: [ :each | each = 'h' ]) = 'h'.
+	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
 	self 
 		should: [ self collection detect: [ :each | each = 6 ] ]
 		raise: Error
 !
 
 testEquality
-	self assert: 'hello' = 'hello'.
+	self assert: 'hello' equals: 'hello'.
 	self deny: 'hello' = 'world'.
 
-	self assert: 'hello'  = 'hello' yourself.
-	self assert: 'hello' yourself = 'hello'.
+	self assert: 'hello'  equals: 'hello' yourself.
+	self assert: 'hello' yourself equals: 'hello'.
 
 	"test JS falsy value"
 	self deny: '' = 0
@@ -771,7 +781,7 @@ testIncludesSubString
 !
 
 testJoin
-	self assert: 'hello,world' equals: (',' join: #('hello' 'world'))
+	self assert: (',' join: #('hello' 'world')) equals: 'hello,world'
 !
 
 testSelect
@@ -790,11 +800,11 @@ testSize
 
 testStreamContents
 	self 
-		assert: 'hello world' 
-		equals: (String streamContents: [ :aStream | 
+		assert: (String streamContents: [ :aStream | 
 			aStream 
 				nextPutAll: 'hello'; space; 
 				nextPutAll: 'world' ])
+		equals: 'hello world'
 ! !
 
 !StringTest class methodsFor: 'accessing'!
@@ -828,9 +838,9 @@ testAsSymbol
 !
 
 testAt
-	self assert: (#hello at: 1) = 'h'.
-	self assert: (#hello at: 5) = 'o'.
-	self assert: (#hello at: 6 ifAbsent: [nil]) = nil
+	self assert: (#hello at: 1) equals: 'h'.
+	self assert: (#hello at: 5) equals: 'o'.
+	self assert: (#hello at: 6 ifAbsent: [nil]) equals: nil
 !
 
 testAtPut
@@ -867,20 +877,20 @@ testCopying
 !
 
 testDetect
-	self assert: (self collection detect: [ :each | each = 'h' ]) = 'h'.
+	self assert: (self collection detect: [ :each | each = 'h' ]) equals: 'h'.
 	self 
 		should: [ self collection detect: [ :each | each = 'z' ] ]
 		raise: Error
 !
 
 testEquality
-	self assert: #hello = #hello.
+	self assert: (#hello = #hello).
 	self deny: #hello = #world.
 
-	self assert: #hello  = #hello yourself.
-	self assert: #hello yourself = #hello.
+	self assert: (#hello = #hello yourself).
+	self assert: (#hello yourself = #hello).
 
-	self deny: #hello  = 'hello'.
+	self deny: #hello = 'hello'.
 	self deny: 'hello' = #hello.
 !
 
@@ -939,10 +949,10 @@ jsObject
 testAtIfAbsent
 	| testObject |
     testObject := self jsObject.
-	self assert: 'Property does not exist' equals: (testObject at: 'abc' ifAbsent: ['Property does not exist']).
-	self assert: nil equals: (testObject at: 'e' ifAbsent: ['Property does not exist']).
-    self assert: 1 equals: (testObject at: 'a' ifAbsent: ['Property does not exist']).
-    self assert: nil equals: (testObject at: 'f' ifAbsent: ['Property does not exist']).
+	self assert: (testObject at: 'abc' ifAbsent: ['Property does not exist']) equals: 'Property does not exist'.
+	self assert: (testObject at: 'e' ifAbsent: ['Property does not exist']) equals: nil.
+    self assert: (testObject at: 'a' ifAbsent: ['Property does not exist']) equals: 1.
+    self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
 !
 
 testDNU
@@ -961,17 +971,17 @@ testMethodWithArguments
 !
 
 testPrinting
-	self assert: self jsObject printString = '[object Object]'
+	self assert: self jsObject printString equals: '[object Object]'
 !
 
 testPropertyThatReturnsEmptyString
 	| object |
 
 	object := self jsObject.
-	self assert: '' equals: object d.
+	self assert: object d equals: ''.
 
 	object d: 'hello'.
-	self assert: 'hello' equals: object d
+	self assert: object d equals: 'hello'
 !
 
 testPropertyThatReturnsUndefined
@@ -985,9 +995,9 @@ testPropertyThatReturnsUndefined
 testValue
 	| testObject |
     testObject := self jsObject.
-	self assert: '[object Object]' equals: testObject value printString.
+	self assert: testObject value printString equals: '[object Object]'.
     testObject at: 'value' put: 'aValue'.
-	self assert: 'aValue' equals: testObject value
+	self assert: testObject value equals: 'aValue'
 !
 
 testYourself
@@ -1009,7 +1019,7 @@ throwException
 	<throw 'test'>
 ! !
 
-!JavaScriptExceptionTest methodsFor: 'testing'!
+!JavaScriptExceptionTest methodsFor: 'tests'!
 
 testCatchingException
 	[ self throwException ]
@@ -1029,8 +1039,8 @@ TestCase subclass: #NumberTest
 !NumberTest methodsFor: 'tests'!
 
 testAbs
-	self assert: 4 abs = 4.
-	self assert: -4 abs = 4
+	self assert: 4 abs equals: 4.
+	self assert: -4 abs equals: 4
 !
 
 testArithmetic
@@ -1038,16 +1048,15 @@ testArithmetic
 	"We rely on JS here, so we won't test complex behavior, just check if 
 	message sends are corrects"
 
-	self assert: 1.5 + 1 = 2.5.
-	self assert: 2 - 1 = 1.
-	self assert: -2 - 1 = -3.
-	self assert: 12 / 2 = 6.
-	self assert: 3 * 4 = 12.
+	self assert: 1.5 + 1 equals: 2.5.
+	self assert: 2 - 1 equals: 1.
+	self assert: -2 - 1 equals: -3.
+	self assert: 12 / 2 equals: 6.
+	self assert: 3 * 4 equals: 12.
 
 	"Simple parenthesis and execution order"
-
-	self assert: 1 + 2 * 3 = 9.
-	self assert: 1 + (2 * 3) = 7
+	self assert: 1 + 2 * 3 equals: 9.
+	self assert: 1 + (2 * 3) equals: 7
 !
 
 testComparison
@@ -1070,13 +1079,13 @@ testCopying
 !
 
 testEquality
-	self assert: 1 = 1.
-	self assert: 0 = 0.
-	self deny: 1 = 0.
+	self assert: (1 = 1).
+	self assert: (0 = 0).
+	self deny: (1 = 0).
 
-	self assert: 1 yourself = 1.
-	self assert: 1 = 1 yourself.
-	self assert: 1 yourself = 1 yourself.
+	self assert: (1 yourself = 1).
+	self assert: (1 = 1 yourself).
+	self assert: (1 yourself = 1 yourself).
 	
 	self deny: 0 = false.
 	self deny: false = 0.
@@ -1086,13 +1095,13 @@ testEquality
 
 testHexNumbers
 
-	self assert: 16r9 = 9.
-	self assert: 16rA truncated = 10.
-	self assert: 16rB truncated = 11.
-	self assert: 16rC truncated = 12.
-	self assert: 16rD truncated = 13.
-	self assert: 16rE truncated = 14.
-	self assert: 16rF truncated = 15
+	self assert: 16r9 equals: 9.
+	self assert: 16rA truncated equals: 10.
+	self assert: 16rB truncated equals: 11.
+	self assert: 16rC truncated equals: 12.
+	self assert: 16rD truncated equals: 13.
+	self assert: 16rE truncated equals: 14.
+	self assert: 16rF truncated equals: 15
 !
 
 testIdentity
@@ -1159,42 +1168,42 @@ testMinMax
 !
 
 testNegated
-	self assert: 3 negated = -3.
-	self assert: -3 negated = 3
+	self assert: 3 negated equals: -3.
+	self assert: -3 negated equals: 3
 !
 
 testPrintShowingDecimalPlaces
-	self assert: '23.00' equals: (23 printShowingDecimalPlaces: 2).
-	self assert: '23.57' equals: (23.5698 printShowingDecimalPlaces: 2).
-	self assert: '-234.56700' equals:( 234.567 negated printShowingDecimalPlaces: 5).
-	self assert: '23' equals: (23.4567 printShowingDecimalPlaces: 0).
-	self assert: '24' equals: (23.5567 printShowingDecimalPlaces: 0).
-	self assert: '-23' equals: (23.4567 negated printShowingDecimalPlaces: 0).
-	self assert: '-24' equals: (23.5567 negated printShowingDecimalPlaces: 0).
-	self assert: '100000000.0' equals: (100000000 printShowingDecimalPlaces: 1).
-	self assert: '0.98000' equals: (0.98 printShowingDecimalPlaces: 5).
-	self assert: '-0.98' equals: (0.98 negated printShowingDecimalPlaces: 2).
-	self assert: '2.57' equals: (2.567 printShowingDecimalPlaces: 2).
-	self assert: '-2.57' equals: (-2.567 printShowingDecimalPlaces: 2).
-	self assert: '0.00' equals: (0 printShowingDecimalPlaces: 2).
+	self assert: (23 printShowingDecimalPlaces: 2) equals: '23.00'.
+	self assert: (23.5698 printShowingDecimalPlaces: 2) equals: '23.57'.
+	self assert: (234.567 negated printShowingDecimalPlaces: 5) equals: '-234.56700'.
+	self assert: (23.4567 printShowingDecimalPlaces: 0) equals: '23'.
+	self assert: (23.5567 printShowingDecimalPlaces: 0) equals: '24'.
+	self assert: (23.4567 negated printShowingDecimalPlaces: 0) equals: '-23'.
+	self assert: (23.5567 negated printShowingDecimalPlaces: 0) equals: '-24'.
+	self assert: (100000000 printShowingDecimalPlaces: 1) equals: '100000000.0'.
+	self assert: (0.98 printShowingDecimalPlaces: 5) equals: '0.98000'.
+	self assert: (0.98 negated printShowingDecimalPlaces: 2) equals: '-0.98'.
+	self assert: (2.567 printShowingDecimalPlaces: 2) equals: '2.57'.
+	self assert: (-2.567 printShowingDecimalPlaces: 2) equals: '-2.57'.
+	self assert: (0 printShowingDecimalPlaces: 2) equals: '0.00'.
 !
 
 testRounded
 	
-	self assert: 3 rounded = 3.
-	self assert: 3.212 rounded = 3.
-	self assert: 3.51 rounded = 4
+	self assert: 3 rounded equals: 3.
+	self assert: 3.212 rounded equals: 3.
+	self assert: 3.51 rounded equals: 4
 !
 
 testSqrt
 	
-	self assert: 4 sqrt = 2.
-	self assert: 16 sqrt = 4
+	self assert: 4 sqrt equals: 2.
+	self assert: 16 sqrt equals: 4
 !
 
 testSquared
 	
-	self assert: 4 squared = 16
+	self assert: 4 squared equals: 16
 !
 
 testTimesRepeat
@@ -1220,9 +1229,9 @@ testToBy
 
 testTruncated
 	
-	self assert: 3 truncated = 3.
-	self assert: 3.212 truncated = 3.
-	self assert: 3.51 truncated = 3
+	self assert: 3 truncated equals: 3.
+	self assert: 3.212 truncated equals: 3.
+	self assert: 3.51 truncated equals: 3
 ! !
 
 Object subclass: #ObjectMock
@@ -1265,7 +1274,7 @@ testBasicPerform
 	o basicAt: 'func' put: ['hello'].	
 	o basicAt: 'func2' put: [:a | a + 1].
 
-	self assert: (o basicPerform: 'func')	 equals: 'hello'.
+	self assert: (o basicPerform: 'func') equals: 'hello'.
 	self assert: (o basicPerform: 'func2' withArguments: #(3)) equals: 4
 !
 
@@ -1277,9 +1286,9 @@ testEquality
 	| o |
 	o := Object new.
 	self deny: o = Object new.
-	self assert: o = o.
-	self assert: o yourself = o.
-	self assert: o = o yourself
+	self assert: (o = o).
+	self assert: (o yourself = o).
+	self assert: (o = o yourself)
 !
 
 testHalt
@@ -1298,10 +1307,10 @@ testIdentity
 testIfNil
 	self deny: Object new isNil.
 	self deny: (Object new ifNil: [true]) = true.
-	self assert: (Object new ifNotNil: [true]) = true.
+	self assert: (Object new ifNotNil: [true]) equals: true.
 
-	self assert: (Object new ifNil: [false] ifNotNil: [true]) = true.
-	self assert: (Object new ifNotNil: [true] ifNil: [false]) = true
+	self assert: (Object new ifNil: [false] ifNotNil: [true]) equals: true.
+	self assert: (Object new ifNotNil: [true] ifNil: [false]) equals: true
 !
 
 testInstVars
@@ -1317,7 +1326,7 @@ testInstVars
 testNilUndefined
 	"nil in Smalltalk is the undefined object in JS"
 
-	self assert: nil = self notDefined
+	self assert: self notDefined equals: nil
 !
 
 testYourself
@@ -1365,19 +1374,19 @@ tearDown
 !PackageTest methodsFor: 'tests'!
 
 testGrulCommitPathJsShouldBeServerGrulJs
-	self assert: 'server/grul/js' equals: grulPackage commitPathJs
+	self assert: grulPackage commitPathJs equals: 'server/grul/js'
 !
 
 testGrulCommitPathStShouldBeGrulSt
-	self assert: 'grul/st' equals: grulPackage commitPathSt
+	self assert: grulPackage commitPathSt equals: 'grul/st'
 !
 
 testZorkCommitPathJsShouldBeJs
-	self assert: 'js' equals: zorkPackage commitPathJs
+	self assert: zorkPackage commitPathJs equals: 'js'
 !
 
 testZorkCommitPathStShouldBeSt
-	self assert: 'st' equals: zorkPackage commitPathSt
+	self assert: zorkPackage commitPathSt equals: 'st'
 ! !
 
 PackageTest subclass: #PackageWithDefaultCommitPathChangedTest
@@ -1397,19 +1406,19 @@ setUp
 !PackageWithDefaultCommitPathChangedTest methodsFor: 'tests'!
 
 testGrulCommitPathJsShouldBeServerGrulJs
-	self assert: 'server/grul/js' equals: grulPackage commitPathJs
+	self assert: grulPackage commitPathJs equals: 'server/grul/js'
 !
 
 testGrulCommitPathStShouldBeGrulSt
-	self assert: 'grul/st' equals: grulPackage commitPathSt
+	self assert: grulPackage commitPathSt equals: 'grul/st'
 !
 
 testZorkCommitPathJsShouldBeJavascript
-	self assert: 'javascripts/' equals: zorkPackage commitPathJs
+	self assert: zorkPackage commitPathJs equals: 'javascripts/'
 !
 
 testZorkCommitPathStShouldBeSmalltalk
-	self assert: 'smalltalk/' equals: zorkPackage commitPathSt
+	self assert: zorkPackage commitPathSt equals: 'smalltalk/'
 ! !
 
 !PackageWithDefaultCommitPathChangedTest class methodsFor: 'accessing'!
@@ -1443,15 +1452,15 @@ testAt
 !
 
 testEgality
-	self assert: 3@4 = (3@4).
+	self assert: (3@4 = (3@4)).
 	self deny: 3@5 = (3@6)
 !
 
 testTranslateBy
-	self assert: 3@4 equals: (3@3 translateBy: 0@1).
-	self assert: 3@2 equals: (3@3 translateBy: 0@1 negated).
-	self assert: 5@6 equals: (3@3 translateBy: 2@3).
-	self assert: 0@3 equals: (3@3 translateBy: 3 negated @0).
+	self assert: (3@3 translateBy: 0@1) equals: 3@4.
+	self assert: (3@3 translateBy: 0@1 negated) equals: 3@2.
+	self assert: (3@3 translateBy: 2@3) equals: 5@6.
+	self assert: (3@3 translateBy: 3 negated @0) equals: 0@3.
 ! !
 
 TestCase subclass: #RandomTest
@@ -1498,7 +1507,7 @@ testAt
 !
 
 testCollect
-	self assert: #(0 2) asSet equals: (#(5 6 8) asSet collect: [ :x | x \\ 3 ])
+	self assert: (#(5 6 8) asSet collect: [ :x | x \\ 3 ]) equals: #(0 2) asSet
 !
 
 testComparing
@@ -1511,17 +1520,17 @@ testComparing
 testPrintString
 	| set |
 	set := Set new.
-	self assert: 'a Set ()' equals: ( set printString ).
+	self assert: set printString equals: 'a Set ()'.
 	set add: 1; add: 3.
-	self assert: 'a Set (1 3)' equals: ( set printString ).
+	self assert: set printString equals: 'a Set (1 3)'.
 	set add: 'foo'.
-	self assert: 'a Set (1 3 ''foo'')' equals: ( set printString ).
+	self assert: set printString equals: 'a Set (1 3 ''foo'')'.
 	set remove: 1; remove: 3.
-	self assert: 'a Set (''foo'')' equals: ( set printString ).
+	self assert: set printString equals: 'a Set (''foo'')'.
 	set add: 3.
-	self assert: 'a Set (''foo'' 3)' equals: ( set printString ).
+	self assert: set printString equals: 'a Set (''foo'' 3)'.
 	set add: 3.
-	self assert: 'a Set (''foo'' 3)' equals: ( set printString ).
+	self assert: set printString equals: 'a Set (''foo'' 3)'
 !
 
 testSize
@@ -1537,10 +1546,10 @@ testUnicity
 	set add: 'hello'.
 
 	set add: 21.
-	self assert: set size = 2.
+	self assert: set size equals: 2.
 	
 	set add: 'hello'.
-	self assert: set size = 2.
+	self assert: set size equals: 2.
 
 	self assert: set asArray equals: #(21 'hello')
 ! !

+ 10 - 10
st/SUnit-Tests.st

@@ -23,7 +23,7 @@ testAdd
 
 testGrow
 	empty addAll: (1 to: 100).
-	self assert: empty size = 100
+	self assert: empty size equals: 100
 !
 
 testIllegal
@@ -41,10 +41,10 @@ testIncludes
 !
 
 testOccurrences
-	self assert: (empty occurrencesOf: 0) = 0.
-	self assert: (full occurrencesOf: 5) = 1.
+	self assert: (empty occurrencesOf: 0) equals: 0.
+	self assert: (full occurrencesOf: 5) equals: 1.
 	full add: 5.
-	self assert: (full occurrencesOf: 5) = 1
+	self assert: (full occurrencesOf: 5) equals: 1
 !
 
 testRemove
@@ -123,8 +123,8 @@ testAsyncErrorsAndFailures
     self timeout: 200.
 	result := runner result.
     assertBlock := self async: [
-		self assert: #('fakeError') asSet equals: (self selectorSetOf: result errors).
-		self assert: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet equals: (self selectorSetOf: result failures).
+		self assert: (self selectorSetOf: result errors) equals: #('fakeError') asSet.
+		self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.
 		self finished
   	].
     runner announcer on: ResultAnnouncement do: [:ann |
@@ -166,8 +166,8 @@ testTimeouts
     self timeout: 200.
 	result := runner result.
     assertBlock := self async: [
-		self assert: Set new equals: (self selectorSetOf: result errors).
-		self assert: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet equals: (self selectorSetOf: result failures).
+		self assert: (self selectorSetOf: result errors) equals: Set new.
+		self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.
 		self finished
   	].
     runner announcer on: ResultAnnouncement do: [:ann |
@@ -180,7 +180,7 @@ testTwoAsyncPassesWithFinishedOnlyOneIsRun
 	flag := 'bad'.
 	self timeout: 10.
     x := 0.
-    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: 1 equals: x ]) valueWithTimeout: 0.
-    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: 1 equals: x ]) valueWithTimeout: 0.
+    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
+    flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.
 ! !
 

+ 2 - 2
st/SUnit.st

@@ -112,8 +112,8 @@ assert: aBoolean description: aString
 	aBoolean ifFalse: [self signalFailure: aString]
 !
 
-assert: expected equals: actual
-	^ self assert: (expected = actual) description: 'Expected: ', expected asString, ' but was: ', actual asString
+assert: actual equals: expected
+	^ self assert: (actual = expected) description: 'Expected: ', expected asString, ' but was: ', actual asString
 !
 
 deny: aBoolean

Some files were not shown because too many files changed in this diff