Browse Source

Be on the safe side, ObjectTest>>testIdentity checks all pairs from ObjectTest>>testEquality.

Herbert Vojčík 12 years ago
parent
commit
900079a789
3 changed files with 9 additions and 3 deletions
  1. 2 0
      js/Kernel-Tests.deploy.js
  2. 4 2
      js/Kernel-Tests.js
  3. 3 1
      st/Kernel-Tests.st

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

@@ -872,6 +872,8 @@ var o=nil;
 (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
 smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
 smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [smalltalk.send(o, "_yourself", [])])]);
 return self;}
 }),
 smalltalk.ObjectTest);

+ 4 - 2
js/Kernel-Tests.js

@@ -1163,10 +1163,12 @@ var o=nil;
 (o=smalltalk.send((smalltalk.Object || Object), "_new", []));
 smalltalk.send(self, "_deny_", [smalltalk.send(o, "__eq_eq", [smalltalk.send((smalltalk.Object || Object), "_new", [])])]);
 smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [o])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(o, "_yourself", []), "__eq_eq", [o])]);
+smalltalk.send(self, "_assert_", [smalltalk.send(o, "__eq_eq", [smalltalk.send(o, "_yourself", [])])]);
 return self;},
 args: [],
-source: "testIdentity\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09self deny: o == Object new.\x0a\x09self assert: o == o",
-messageSends: ["new", "deny:", "==", "assert:"],
+source: "testIdentity\x0a\x09| o |\x0a\x09o := Object new.\x0a\x09self deny: o == Object new.\x0a\x09self assert: o == o.\x0a\x09self assert: o yourself == o.\x0a\x09self assert: o == o yourself",
+messageSends: ["new", "deny:", "==", "assert:", "yourself"],
 referencedClasses: ["Object"]
 }),
 smalltalk.ObjectTest);

+ 3 - 1
st/Kernel-Tests.st

@@ -588,7 +588,9 @@ testIdentity
 	| o |
 	o := Object new.
 	self deny: o == Object new.
-	self assert: o == o
+	self assert: o == o.
+	self assert: o yourself == o.
+	self assert: o == o yourself
 !
 
 testIfNil