Skip to content

Commit

Permalink
displayStringOn: send displayStringOn: message
Browse files Browse the repository at this point in the history
  • Loading branch information
vonbecmann committed Nov 7, 2023
1 parent cb7eaf9 commit d57f92a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
11 changes: 5 additions & 6 deletions repository/LinkedList-Core/IdentityOrderedPair.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ IdentityOrderedPair >> = aPair [
{ #category : #displaying }
IdentityOrderedPair >> displayStringOn: aStream [

aStream
nextPut: $<;
print: first;
nextPutAll: ', ';
print: second;
nextPut: $>
aStream nextPut: $<.
first displayStringOn: aStream.
aStream nextPutAll: ', '.
second displayStringOn: aStream.
aStream nextPut: $>
]

{ #category : #comparing }
Expand Down
12 changes: 6 additions & 6 deletions repository/LinkedList-Core/OrderedPair.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ OrderedPair >> = aPair [

{ #category : #displaying }
OrderedPair >> displayStringOn: aStream [
aStream
nextPut: $(;
print: first;
nextPutAll: ', ';
print: second;
nextPut: $)

aStream nextPut: $(.
first displayStringOn: aStream.
aStream nextPutAll: ', '.
second displayStringOn: aStream.
aStream nextPut: $)
]

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IdentityOrderedPairTest >> testDisplayString [
| one |
one := IdentityOrderedPair first: 'A' second: 1.

self assert: one displayString equals: '<''A'', 1>'
self assert: one displayString equals: '<A, 1>'
]

{ #category : #tests }
Expand Down
2 changes: 1 addition & 1 deletion repository/LinkedList-Tests/OrderedPairTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OrderedPairTest >> testDisplayString [
| one |
one := OrderedPair first: 'A' second: 1.

self assert: one displayString equals: '(''A'', 1)'
self assert: one displayString equals: '(A, 1)'
]

{ #category : #tests }
Expand Down

0 comments on commit d57f92a

Please sign in to comment.