[squeak-dev] The Trunk: Tests-nice.458.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Apr 30 17:01:47 UTC 2021


Hi Nicolas,


I appreciate all your work, but it would be great if you could also check the inbox before. I already had implemented equivalent tests in Tests-ct.447 three months ago. Now I feel a tiny little bit nihilistic. :-)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Mittwoch, 28. April 2021 18:12:10
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Tests-nice.458.mcz

Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.458.mcz

==================== Summary ====================

Name: Tests-nice.458
Author: nice
Time: 28 April 2021, 6:11:51.033213 pm
UUID: 13fec56a-805e-754e-bd02-8cbaa015e102
Ancestors: Tests-jr.457

Document the fact that becomeForward: does NOT forward identityHash of receiver anymore (since Collections-eem.885 April 2020)

See #elementsForwardIdentityTo: vs #elementsForwardIdentityAndHashTo:

See also http://forum.world.st/How-to-become-immediate-objects-td5114931.html

=============== Diff against Tests-jr.457 ===============

Item was changed:
  ----- Method: BecomeTest>>testBecomeForward (in category 'tests') -----
  testBecomeForward
         "Test the forward become."
         | a b c d |

         a := 'ab' copy.
         b := 'cd' copy.
+        c := Array with: a.
-        c := a.
         d := b.

         a becomeForward: b.

         self
                 assert: a = 'cd';
                 assert: b = 'cd';
+                assert: a == b;
+                assert: c first == b;
+                assert: d == b.
-                assert: c = 'cd';
-                assert: d = 'cd'.

-
  !

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 |
+
+        a := 'ab' copy.
+        b := 'cd' copy.
+        ha := a identityHash.
+
+        a becomeForward: b copyHash: true.
+
+        self
+                assert: a identityHash = ha;
+                assert: b identityHash = ha.
+
+ !

Item was changed:
  ----- Method: BecomeTest>>testBecomeForwardDontCopyIdentityHash (in category 'tests') -----
  testBecomeForwardDontCopyIdentityHash
         "Check that
                 1. the argument to becomeForward: is NOT modified to have the receiver's identity hash.
+                2. the receiver's identity hash is changed."
-                2. the receiver's identity hash is unchanged."

         | a b hb |

         a := 'ab' copy.
         b := 'cd' copy.
         hb := b identityHash.

         a becomeForward: b copyHash: false.

         self
                 assert: a identityHash = hb;
                 assert: b identityHash = hb.

  !

Item was changed:
  ----- Method: BecomeTest>>testBecomeForwardIdentityHash (in category 'tests') -----
  testBecomeForwardIdentityHash
+        "Document that the receiver hash is changed, but the argument hash is unchanged.
+        (a becomeForward: b) has thus same effect as (a becomeForward: b copyHash: false)"
-        "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 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.

  !


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210430/d78f04ad/attachment.html>


More information about the Squeak-dev mailing list