소스 검색

AssociationTest: replace assert: with assert:equals:

mkroehnert 12 년 전
부모
커밋
f8e69d6df8
3개의 변경된 파일49개의 추가작업 그리고 47개의 파일을 삭제
  1. 11 11
      js/Kernel-Tests.deploy.js
  2. 25 25
      js/Kernel-Tests.js
  3. 13 11
      st/Kernel-Tests.st

+ 11 - 11
js/Kernel-Tests.deploy.js

@@ -78,8 +78,8 @@ var value=nil;
 (key="KEY_STRING");
 (value="VALUE_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", [key, value]));
-smalltalk.send(self, "_assert_", [smalltalk.send(key, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(value, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -94,7 +94,7 @@ var anAssociation=nil;
 var anotherAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
-smalltalk.send(self, "_assert_", [smalltalk.send(anAssociation, "__eq", [anotherAssociation])]);
+smalltalk.send(self, "_assert_equals_", [anAssociation, anotherAssociation]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -110,8 +110,8 @@ var key=nil;
 (key="KEY_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
 smalltalk.send(anAssociation, "_key_", [key]);
-smalltalk.send(self, "_assert_", [smalltalk.send(key, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -126,7 +126,7 @@ var anAssociation=nil;
 var anotherAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY2", "VALUE2"]));
-smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(anAssociation, "__eq", [anotherAssociation]), "_not", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(anAssociation, "__eq", [anotherAssociation])]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -141,7 +141,7 @@ var anAssociation=nil;
 var returnString=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (returnString=smalltalk.send(anAssociation, "_printString", []));
-smalltalk.send(self, "_assert_", [smalltalk.send("'KEY'->'VALUE'", "__eq", [returnString])]);
+smalltalk.send(self, "_assert_equals_", ["'KEY'->'VALUE'", returnString]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -154,8 +154,8 @@ fn: function (){
 var self=this;
 var anAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
 return self;}
 }),
 smalltalk.AssociationTest);
@@ -171,8 +171,8 @@ var value=nil;
 (value="VALUE_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
 smalltalk.send(anAssociation, "_value_", [value]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(value, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
 return self;}
 }),
 smalltalk.AssociationTest);

+ 25 - 25
js/Kernel-Tests.js

@@ -99,12 +99,12 @@ var value=nil;
 (key="KEY_STRING");
 (value="VALUE_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", [key, value]));
-smalltalk.send(self, "_assert_", [smalltalk.send(key, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(value, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
 return self;},
 args: [],
-source: "testClassCreation\x0a\x09\x22Test if Associatin object created via the class method contains correct values\x22\x0a\x09| anAssociation key value|\x0a\x09key := 'KEY_STRING'.\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association key: key value: value.\x0a\x0a\x09self assert: (key = anAssociation key).\x0a\x09self assert: (value = anAssociation value).",
-messageSends: ["key:value:", "assert:", "=", "key", "value"],
+source: "testClassCreation\x0a\x09\x22Test if Associatin object created via the class method contains correct values\x22\x0a\x09| anAssociation key value|\x0a\x09key := 'KEY_STRING'.\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association key: key value: value.\x0a\x0a\x09self assert: key equals: anAssociation key.\x0a\x09self assert: value equals: anAssociation value.",
+messageSends: ["key:value:", "assert:equals:", "key", "value"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -120,11 +120,11 @@ var anAssociation=nil;
 var anotherAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
-smalltalk.send(self, "_assert_", [smalltalk.send(anAssociation, "__eq", [anotherAssociation])]);
+smalltalk.send(self, "_assert_equals_", [anAssociation, anotherAssociation]);
 return self;},
 args: [],
-source: "testEqualAssociations\x0a\x09\x22Test if two equal Association objects compare to true\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x0a\x09self assert: (anAssociation = anotherAssociation).",
-messageSends: ["key:value:", "assert:", "="],
+source: "testEqualAssociations\x0a\x09\x22Test if two equal Association objects compare to true\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x0a\x09self assert: anAssociation equals: anotherAssociation.",
+messageSends: ["key:value:", "assert:equals:"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -141,12 +141,12 @@ var key=nil;
 (key="KEY_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
 smalltalk.send(anAssociation, "_key_", [key]);
-smalltalk.send(self, "_assert_", [smalltalk.send(key, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [key, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
 return self;},
 args: [],
-source: "testKeyAccess\x0a\x09\x22Test getter and setter messages for Association keys\x22\x0a\x09| anAssociation key |\x0a\x09key := 'KEY_STRING'.\x0a\x09anAssociation := Association new.\x0a\x09anAssociation key: key.\x0a\x0a\x09self assert: (key = anAssociation key).\x0a\x09self assert: (nil = anAssociation value).",
-messageSends: ["new", "key:", "assert:", "=", "key", "value"],
+source: "testKeyAccess\x0a\x09\x22Test getter and setter messages for Association keys\x22\x0a\x09| anAssociation key |\x0a\x09key := 'KEY_STRING'.\x0a\x09anAssociation := Association new.\x0a\x0a\x09anAssociation key: key.\x0a\x0a\x09self assert: key equals: anAssociation key.\x0a\x09self assert: nil equals: anAssociation value.",
+messageSends: ["new", "key:", "assert:equals:", "key", "value"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -162,11 +162,11 @@ var anAssociation=nil;
 var anotherAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (anotherAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY2", "VALUE2"]));
-smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(anAssociation, "__eq", [anotherAssociation]), "_not", [])]);
+smalltalk.send(self, "_deny_", [smalltalk.send(anAssociation, "__eq", [anotherAssociation])]);
 return self;},
 args: [],
-source: "testNotEqualAssociations\x0a\x09\x22Test if two unequal Association objects compare to false\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY2' value: 'VALUE2'.\x0a\x0a\x09self assert: (anAssociation = anotherAssociation) not.",
-messageSends: ["key:value:", "assert:", "not", "="],
+source: "testNotEqualAssociations\x0a\x09\x22Test if two unequal Association objects compare to false\x22\x0a\x09| anAssociation anotherAssociation |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09anotherAssociation := Association key: 'KEY2' value: 'VALUE2'.\x0a\x0a\x09self deny: (anAssociation = anotherAssociation).",
+messageSends: ["key:value:", "deny:", "="],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -182,11 +182,11 @@ var anAssociation=nil;
 var returnString=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_key_value_", ["KEY", "VALUE"]));
 (returnString=smalltalk.send(anAssociation, "_printString", []));
-smalltalk.send(self, "_assert_", [smalltalk.send("'KEY'->'VALUE'", "__eq", [returnString])]);
+smalltalk.send(self, "_assert_equals_", ["'KEY'->'VALUE'", returnString]);
 return self;},
 args: [],
-source: "testPrintString\x0a\x09\x22Test if the output of the printString message is correct\x22\x0a\x09| anAssociation returnString |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09returnString := anAssociation printString.\x0a\x0a\x09self assert: ('''KEY''->''VALUE''' = returnString).",
-messageSends: ["key:value:", "printString", "assert:", "="],
+source: "testPrintString\x0a\x09\x22Test if the output of the printString message is correct\x22\x0a\x09| anAssociation returnString |\x0a\x09anAssociation := Association key: 'KEY' value: 'VALUE'.\x0a\x09returnString := anAssociation printString.\x0a\x0a\x09self assert: '''KEY''->''VALUE''' equals: returnString.",
+messageSends: ["key:value:", "printString", "assert:equals:"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -200,12 +200,12 @@ fn: function (){
 var self=this;
 var anAssociation=nil;
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_value", [])]);
 return self;},
 args: [],
-source: "testUninitializedObject\x0a\x09\x22Test if uninitialized Associatin object contains correct values\x22\x0a\x09| anAssociation |\x0a\x09anAssociation := Association new.\x0a\x0a\x09self assert: (nil = anAssociation key).\x0a\x09self assert: (nil = anAssociation value).",
-messageSends: ["new", "assert:", "=", "key", "value"],
+source: "testUninitializedObject\x0a\x09\x22Test if uninitialized Associatin object contains correct values\x22\x0a\x09| anAssociation |\x0a\x09anAssociation := Association new.\x0a\x0a\x09self assert: nil equals: anAssociation key.\x0a\x09self assert: nil equals: anAssociation value.",
+messageSends: ["new", "assert:equals:", "key", "value"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);
@@ -222,12 +222,12 @@ var value=nil;
 (value="VALUE_STRING");
 (anAssociation=smalltalk.send((smalltalk.Association || Association), "_new", []));
 smalltalk.send(anAssociation, "_value_", [value]);
-smalltalk.send(self, "_assert_", [smalltalk.send(nil, "__eq", [smalltalk.send(anAssociation, "_key", [])])]);
-smalltalk.send(self, "_assert_", [smalltalk.send(value, "__eq", [smalltalk.send(anAssociation, "_value", [])])]);
+smalltalk.send(self, "_assert_equals_", [nil, smalltalk.send(anAssociation, "_key", [])]);
+smalltalk.send(self, "_assert_equals_", [value, smalltalk.send(anAssociation, "_value", [])]);
 return self;},
 args: [],
-source: "testValueAccess\x0a\x09\x22Test getter and setter messages for Association values\x22\x0a\x09| anAssociation value |\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association new.\x0a\x09anAssociation value: value.\x0a\x0a\x09self assert: (nil = anAssociation key).\x0a\x09self assert: (value = anAssociation value).",
-messageSends: ["new", "value:", "assert:", "=", "key", "value"],
+source: "testValueAccess\x0a\x09\x22Test getter and setter messages for Association values\x22\x0a\x09| anAssociation value |\x0a\x09value := 'VALUE_STRING'.\x0a\x09anAssociation := Association new.\x0a\x0a\x09anAssociation value: value.\x0a\x0a\x09self assert: nil equals: anAssociation key.\x0a\x09self assert: value equals: anAssociation value.",
+messageSends: ["new", "value:", "assert:equals:", "key", "value"],
 referencedClasses: ["Association"]
 }),
 smalltalk.AssociationTest);

+ 13 - 11
st/Kernel-Tests.st

@@ -53,8 +53,8 @@ testClassCreation
 	value := 'VALUE_STRING'.
 	anAssociation := Association key: key value: value.
 
-	self assert: (key = anAssociation key).
-	self assert: (value = anAssociation value).
+	self assert: key equals: anAssociation key.
+	self assert: value equals: anAssociation value.
 !
 
 testEqualAssociations
@@ -63,7 +63,7 @@ testEqualAssociations
 	anAssociation := Association key: 'KEY' value: 'VALUE'.
 	anotherAssociation := Association key: 'KEY' value: 'VALUE'.
 
-	self assert: (anAssociation = anotherAssociation).
+	self assert: anAssociation equals: anotherAssociation.
 !
 
 testKeyAccess
@@ -71,10 +71,11 @@ testKeyAccess
 	| anAssociation key |
 	key := 'KEY_STRING'.
 	anAssociation := Association new.
+
 	anAssociation key: key.
 
-	self assert: (key = anAssociation key).
-	self assert: (nil = anAssociation value).
+	self assert: key equals: anAssociation key.
+	self assert: nil equals: anAssociation value.
 !
 
 testNotEqualAssociations
@@ -83,7 +84,7 @@ testNotEqualAssociations
 	anAssociation := Association key: 'KEY' value: 'VALUE'.
 	anotherAssociation := Association key: 'KEY2' value: 'VALUE2'.
 
-	self assert: (anAssociation = anotherAssociation) not.
+	self deny: (anAssociation = anotherAssociation).
 !
 
 testPrintString
@@ -92,7 +93,7 @@ testPrintString
 	anAssociation := Association key: 'KEY' value: 'VALUE'.
 	returnString := anAssociation printString.
 
-	self assert: ('''KEY''->''VALUE''' = returnString).
+	self assert: '''KEY''->''VALUE''' equals: returnString.
 !
 
 testUninitializedObject
@@ -100,8 +101,8 @@ testUninitializedObject
 	| anAssociation |
 	anAssociation := Association new.
 
-	self assert: (nil = anAssociation key).
-	self assert: (nil = anAssociation value).
+	self assert: nil equals: anAssociation key.
+	self assert: nil equals: anAssociation value.
 !
 
 testValueAccess
@@ -109,10 +110,11 @@ testValueAccess
 	| anAssociation value |
 	value := 'VALUE_STRING'.
 	anAssociation := Association new.
+
 	anAssociation value: value.
 
-	self assert: (nil = anAssociation key).
-	self assert: (value = anAssociation value).
+	self assert: nil equals: anAssociation key.
+	self assert: value equals: anAssociation value.
 ! !
 
 TestCase subclass: #BlockClosureTest