Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ct.447.mcz
==================== Summary ====================
Name: Tests-ct.447
Author: ct
Time: 18 January 2021, 12:55:37.357232 pm
UUID: 675252a4-a6d9-d442-b594-3c85592290a4
Ancestors: Tests-dtl.443
Fixes and supplements BecomeTest.
- Updated #testBecomeForwardIdentityHash which has been broken since Collections-eem.885. Note that the referenced patch to #becomeForward: was a breaking change which we should make sure to document in the final release notes.
- Added #testBecomeForwardIdentityAndHash to have a test for the classical primitiveArrayBecomeOneWay (primitive 72) again.
- Added #testBecomeForwardCopyIdentityHash to test both bindings of the copyHash argument indeed.
Please review! Fur further reference, see https://github.com/codefrau/SqueakJS/pull/117 where we were discussing the limitations/correctness of the current BecomeTest implementation.
=============== Diff against Tests-dtl.443 ===============
Item was added:
+ ----- Method: BecomeTest>>testBecomeForwardCopyIdentityHash (in category 'tests') -----
+ testBecomeForwardCopyIdentityHash
+ "Check that
+ 1. the argument to becomeForward: is modified to have the receiver's identity hash.
+ 2. the receiver's identity hash is unchanged."
+
+ | a b ha hb |
+ a := 'ab' copy.
+ b := 'cd' copy.
+ ha := a identityHash.
+ hb := b identityHash.
+
+ a becomeForward: b copyHash: true.
+
+ self
+ assert: ha equals: a identityHash;
+ assert: ha equals: b identityHash.!
Item was added:
+ ----- Method: BecomeTest>>testBecomeForwardIdentityAndHash (in category 'tests') -----
+ testBecomeForwardIdentityAndHash
+ "Check that
+ 1. the argument to becomeForward: is NOT modified to have the receiver's identity hash.
+ 2. the receiver's identity hash is unchanged."
+
+ | a b ha |
+ a := 'ab' copy.
+ b := 'cd' copy.
+ ha := a identityHash.
+
+ {a} elementsForwardIdentityAndHashTo: {b}.
+
+ self
+ assert: ha equals: a identityHash;
+ assert: ha equals: b identityHash.!
Item was changed:
----- Method: BecomeTest>>testBecomeForwardIdentityHash (in category 'tests') -----
testBecomeForwardIdentityHash
"Check that
+ 1. the argument to becomeForward: is NOT modified to have the receiver's identity hash.
- 1. the argument to becomeForward: is modified to have the receiver's identity hash.
2. the receiver's identity hash is unchanged."
+ | a b hb |
- | a b ha |
-
a := 'ab' copy.
b := 'cd' copy.
+ hb := b identityHash.
+
- ha := a identityHash.
-
a becomeForward: b.
+
-
self
+ assert: a identityHash = hb;
+ assert: b identityHash = hb.!
- assert: a identityHash = ha;
- assert: b identityHash = ha.
-
- !
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ct.465.mcz
==================== Summary ====================
Name: Tests-ct.465
Author: ct
Time: 18 September 2021, 3:48:23.531191 pm
UUID: 482a8de2-b171-b341-a16c-cb047f6c42fa
Ancestors: Tests-eem.464
Adds regression test for a bug in Environment >> #removeKey:ifAbsent:.
Make sure that the previous value of the binding is returned regardless of what the binding policies might do with it during removal.
See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-August/216287.h…
=============== Diff against Tests-eem.464 ===============
Item was changed:
----- Method: EnvironmentTest>>testRemoveKey (in category 'tests - compatibility') -----
testRemoveKey
"For compatibility with legacy code, environments
should implement the dictionary protocol."
+ env importSelf. "undeclaring the binding via a binding policy while removing it must not affect the return value of #removeKey:."
+ env at: #Griffle put: self.
+ self
+ assert: self
+ equals: (env removeKey: #Griffle).
+ self
+ should: [env removeKey: #Griffle]
- self
- should: [env removeKey: #Griffle]
raise: KeyNotFound.!
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-lrnp.482.mcz
==================== Summary ====================
Name: Tests-lrnp.482
Author: lrnp
Time: 18 April 2022, 5:38:05.257552 pm
UUID: dbcc2021-223d-45e4-9f92-bd5d7429c657
Ancestors: Tests-ct.481
make test class not more restrictive than tested class
A PackageInfo will return false if the categoryName is nil (via #category:matches:), but using #sameAs: will eventually signal an error. Matching PackageInfo's contract allows it to be present in the PackageOrganizer without needing to support it specially.
=============== Diff against Tests-ct.481 ===============
Item was changed:
----- Method: MCMockPackageInfo>>includesSystemCategory: (in category 'testing') -----
includesSystemCategory: categoryName
+ categoryName ifNil: [^false].
^self systemCategories anySatisfy: [:cat | cat sameAs: categoryName]!