From a62027d375cbb5caf9294cb2ac54c2c51bfa0834 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 8 Aug 2023 11:13:39 -0300 Subject: [PATCH] Fix OrderedSet tests in GS64 --- source/Buoy-Collections-Tests/OrderedSetTest.class.st | 2 +- source/Buoy-Collections/OrderedSet.class.st | 9 +++++++++ .../Buoy-SUnit-GS64-Extensions/TestAsserter.extension.st | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/Buoy-Collections-Tests/OrderedSetTest.class.st b/source/Buoy-Collections-Tests/OrderedSetTest.class.st index 3257626..4f3098e 100644 --- a/source/Buoy-Collections-Tests/OrderedSetTest.class.st +++ b/source/Buoy-Collections-Tests/OrderedSetTest.class.st @@ -466,7 +466,7 @@ OrderedSetTest >> testCopyReplaceFromToWithInsertingAtEnd [ original := self abcSet. - copy := original copyReplaceFrom: 4 to: 4 with: 'f'. + copy := original copyReplaceFrom: 4 to: 3 with: 'f'. self assert: copy size equals: 4; diff --git a/source/Buoy-Collections/OrderedSet.class.st b/source/Buoy-Collections/OrderedSet.class.st index 1923a98..cfb69ec 100644 --- a/source/Buoy-Collections/OrderedSet.class.st +++ b/source/Buoy-Collections/OrderedSet.class.st @@ -116,6 +116,15 @@ OrderedSet >> copyFrom: start to: stop [ ^ self species withAll: ( collection copyFrom: start to: stop ) ] +{ #category : #copying } +OrderedSet >> copyReplaceAll: oldSubCollection with: newSubCollection [ + + ^ self species withAll: + (collection + copyReplaceAll: oldSubCollection + with: newSubCollection) +] + { #category : #copying } OrderedSet >> copyReplaceFrom: start to: stop with: replacementCollection [ diff --git a/source/Buoy-SUnit-GS64-Extensions/TestAsserter.extension.st b/source/Buoy-SUnit-GS64-Extensions/TestAsserter.extension.st index d24ccdf..0e5c26f 100644 --- a/source/Buoy-SUnit-GS64-Extensions/TestAsserter.extension.st +++ b/source/Buoy-SUnit-GS64-Extensions/TestAsserter.extension.st @@ -55,7 +55,7 @@ TestAsserter >> should: aBlock raise: anException withExceptionDo: anotherBlock [ aBlock value. false] - sunitOn: anException + on: anException do: [:aSignal | anotherBlock value: aSignal. aSignal sunitExitWith: true].