X Tutup
Skip to content

Commit 7b7648b

Browse files
author
Johan Brichau
authored
Merge pull request SeasideSt#96 from SeasideSt/95-GRIntervalTest--testSorted-assumes-new-collection
95 Don't assume Interval >> #sorted returns a new object
2 parents 7bf975a + a3105c7 commit 7b7648b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
asserting
2+
assert: responseCollection validSequencedResponseFrom: receiverCollection
3+
"Assert that the returned object is of a valid response class for the tested collection."
4+
5+
self assert: (self isValidNewSequencedResponseClass: responseCollection class)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
tests
2+
testSorted
3+
"Unlike super implementation do not assume Interval >> #sorted returns a new object"
4+
| sorted collection |
5+
collection := self arbitraryCollection.
6+
sorted := collection sorted.
7+
self assert: sorted validSequencedResponseFrom: collection.
8+
self assert: sorted sortedWith: [ :a :b | a <= b ].
9+
10+
sorted := collection sorted: [ :a :b | a > b ].
11+
self assert: sorted validSequencedNewResponseFrom: collection.
12+
self assert: sorted sortedWith: [ :a :b | a > b ]

0 commit comments

Comments
 (0)
X Tutup