From d57f92ade7f2cbc2e414bf2033903e7b5d7a0ce3 Mon Sep 17 00:00:00 2001 From: BernardoContreras Date: Tue, 7 Nov 2023 00:55:48 -0300 Subject: [PATCH] displayStringOn: send displayStringOn: message --- .../LinkedList-Core/IdentityOrderedPair.class.st | 11 +++++------ repository/LinkedList-Core/OrderedPair.class.st | 12 ++++++------ .../IdentityOrderedPairTest.class.st | 2 +- repository/LinkedList-Tests/OrderedPairTest.class.st | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/repository/LinkedList-Core/IdentityOrderedPair.class.st b/repository/LinkedList-Core/IdentityOrderedPair.class.st index 5598b9d..c587a26 100644 --- a/repository/LinkedList-Core/IdentityOrderedPair.class.st +++ b/repository/LinkedList-Core/IdentityOrderedPair.class.st @@ -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 } diff --git a/repository/LinkedList-Core/OrderedPair.class.st b/repository/LinkedList-Core/OrderedPair.class.st index 0c8522e..0eb816c 100644 --- a/repository/LinkedList-Core/OrderedPair.class.st +++ b/repository/LinkedList-Core/OrderedPair.class.st @@ -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 } diff --git a/repository/LinkedList-Tests/IdentityOrderedPairTest.class.st b/repository/LinkedList-Tests/IdentityOrderedPairTest.class.st index b6eeb6e..f685260 100644 --- a/repository/LinkedList-Tests/IdentityOrderedPairTest.class.st +++ b/repository/LinkedList-Tests/IdentityOrderedPairTest.class.st @@ -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: '' ] { #category : #tests } diff --git a/repository/LinkedList-Tests/OrderedPairTest.class.st b/repository/LinkedList-Tests/OrderedPairTest.class.st index b522deb..c0af440 100644 --- a/repository/LinkedList-Tests/OrderedPairTest.class.st +++ b/repository/LinkedList-Tests/OrderedPairTest.class.st @@ -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 }