File tree Expand file tree Collapse file tree 7 files changed +36
-2
lines changed
Grease-Pharo100-Core.package/SequenceableCollection.extension/instance
Grease-Pharo90-Slime.package/GRNotPortableCollectionsRule.class/instance
Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance Expand file tree Collapse file tree 7 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 11* Grease - Pharo100 - Core
22beginsWithSubCollection: aSequenceableCollection
33 " Some platforms implement #beginsWith: to answer true for an empty argument."
4+ self
5+ greaseDeprecatedApi: ' SequenceableCollection>>#beginsWithSubCollection:'
6+ details: ' Use SequenceableCollection>>#greaseBegins:' .
7+ aSequenceableCollection isEmpty ifTrue: [ ^ false ].
48 ^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change 11* Grease - Pharo100 - Core
22endsWithSubCollection: aSequenceableCollection
33 " Some platforms implement #endsWith: to answer true for an empty argument."
4+ self
5+ greaseDeprecatedApi: ' SequenceableCollection>>#endsWithSubCollection:'
6+ details: ' Use SequenceableCollection>>#greaseEndsWith:' .
7+ aSequenceableCollection isEmpty ifTrue: [ ^ false ].
48 ^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change 1+ * Grease - Pharo100 - Core
2+ greaseBeginsWith: aSequenceableCollection
3+ aSequenceableCollection isEmpty ifTrue: [ ^ true ].
4+ ^ self beginsWith: aSequenceableCollection
Original file line number Diff line number Diff line change 1+ * Grease - Pharo100 - Core
2+ greaseEndsWith: aSequenceableCollection
3+ aSequenceableCollection isEmpty ifTrue: [ ^ true ].
4+ ^ self endsWith: aSequenceableCollection
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ initialize
33 super initialize.
44 self rewriteRule
55 replace: ' `@collection beginsWith: `@subCollection'
6- with: ' `@collection beginsWithSubCollection : `@subCollection' ;
6+ with: ' `@collection greaseBeginsWith : `@subCollection' ;
77 replace: ' `@collection endsWith: `@subCollection'
8- with: ' `@collection endsWithSubCollection : `@subCollection'
8+ with: ' `@collection greaseEndsWith : `@subCollection'
Original file line number Diff line number Diff line change 1+ tests
2+ testGreaseBeginsWith
3+ | collection |
4+ collection := self arbitraryCollection.
5+ self assert: (collection greaseBeginsWith: (collection copyWithout: collection last)).
6+ self assert: (collection greaseBeginsWith: collection).
7+ self deny: (collection greaseBeginsWith: (collection copyWith: collection first)).
8+ self assert: (collection greaseBeginsWith: self emptyCollection).
9+ self deny: (self emptyCollection greaseBeginsWith: collection)
Original file line number Diff line number Diff line change 1+ tests
2+ testGreaseEndsWith
3+ | collection |
4+ collection := self arbitraryCollection.
5+ self assert: (collection greaseEndsWith: (collection copyWithout: collection first)).
6+ self assert: (collection greaseEndsWith: collection).
7+ self deny: (collection greaseEndsWith: (collection copyWith: collection first)).
8+ self assert: (collection greaseEndsWith: self emptyCollection).
9+ self deny: (self emptyCollection greaseEndsWith: collection)
You can’t perform that action at this time.
0 commit comments