diff --git a/repository/Grease-Tests-Core.package/GRCollectionTest.class/instance/assert.validSequencedResponseFrom..st b/repository/Grease-Tests-Core.package/GRCollectionTest.class/instance/assert.validSequencedResponseFrom..st new file mode 100644 index 00000000..98b858fd --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRCollectionTest.class/instance/assert.validSequencedResponseFrom..st @@ -0,0 +1,5 @@ +asserting +assert: responseCollection validSequencedResponseFrom: receiverCollection + "Assert that the returned object is of a valid response class for the tested collection." + + self assert: (self isValidNewSequencedResponseClass: responseCollection class) \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRIntervalTest.class/instance/testSorted.st b/repository/Grease-Tests-Core.package/GRIntervalTest.class/instance/testSorted.st new file mode 100644 index 00000000..b7b0ada5 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRIntervalTest.class/instance/testSorted.st @@ -0,0 +1,12 @@ +tests +testSorted + "Unlike super implementation do not assume Interval >> #sorted returns a new object" + | sorted collection | + collection := self arbitraryCollection. + sorted := collection sorted. + self assert: sorted validSequencedResponseFrom: collection. + self assert: sorted sortedWith: [ :a :b | a <= b ]. + + sorted := collection sorted: [ :a :b | a > b ]. + self assert: sorted validSequencedNewResponseFrom: collection. + self assert: sorted sortedWith: [ :a :b | a > b ] \ No newline at end of file