Skip to content

Commit

Permalink
Corrected protocol to work in GemStone as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Mar 25, 2024
1 parent 9dc3aac commit d511554
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 7 additions & 1 deletion source/Sagan-Core/InMemoryRepository.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,17 @@ InMemoryRepository >> validatedFindAllFrom: aStartingPosition upTo: aMaximumPosi
to := ( aMaximumPosition min: contents size ) max: 1.

^ ( contents sorted: [ :a :b |
( a instVarNamed: aVariableName asString ) <= ( b instVarNamed: aVariableName asString ) ] )
( self valueOf: aVariableName in: a ) <= ( self valueOf: aVariableName in: b ) ] )
copyFrom: from
to: to
]

{ #category : 'private - accessing' }
InMemoryRepository >> valueOf: aVariableName in: anObject [

^ anObject instVarAt: ( anObject class instVarNames indexOf: aVariableName )
]

{ #category : 'querying' }
InMemoryRepository >> withOneMatching: aCriteriaOrBlock do: foundBlock else: noneBlock [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,7 @@ GemStoneRepositoryProviderTest >> testQueryingInterval [
self
assert: extraterrestrial firstName equals: 'Silvester';
assert: extraterrestrial lastName equals: 'Stallone'
].

result := self extraterrestrials findAllFrom: -50 upTo: 0 sortedByAscending: 'lastName'.
self assert: result isEmpty.
result := self extraterrestrials findAllFrom: 6 upTo: -2 sortedByAscending: 'lastName'.
self assert: result isEmpty.
result := self extraterrestrials findAllFrom: 5000 upTo: 10000 sortedByAscending: 'lastName'.
self assert: result isEmpty
]
]

{ #category : 'tests' }
Expand Down

0 comments on commit d511554

Please sign in to comment.