Browse Source

SUnit-Tests: fix usage of >>assert:equals:

Manfred Kroehnert 11 years ago
parent
commit
64b604d616
3 changed files with 23 additions and 23 deletions
  1. 6 6
      js/SUnit-Tests.deploy.js
  2. 11 11
      js/SUnit-Tests.js
  3. 6 6
      st/SUnit-Tests.st

+ 6 - 6
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);
@@ -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)})}
 }),

+ 11 - 11
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);
@@ -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: []
 }),

+ 6 - 6
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
@@ -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.
 ! !