Skip to content

Commit

Permalink
Revert "Add new #printOneLineString and related methods"
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDenker committed Oct 11, 2019
1 parent bac17c3 commit 9139515
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 119 deletions.
44 changes: 0 additions & 44 deletions src/Collections-Streams/FilteringStream.class.st

This file was deleted.

26 changes: 0 additions & 26 deletions src/Collections-Streams/FilteringStreamTest.class.st

This file was deleted.

25 changes: 0 additions & 25 deletions src/Kernel-Tests/ObjectTest.class.st
Expand Up @@ -102,31 +102,6 @@ ObjectTest >> testPrintLimitedString [
self assert: actual equals: 'an O...etc...'
]

{ #category : #'tests-printing' }
ObjectTest >> testPrintOnOneLine [
|ws|
ws := String new writeStream.
'this is a test' printOnOneLine: ws.
self assert: ws contents equals: '''this is a test'''.

]

{ #category : #'tests-printing' }
ObjectTest >> testPrintOnOneLineString [
self
assert: ('this is a test' printOnOneLineString)
equals: '''this is a test'''.

self
assert: ('this is a', Character cr asString, 'test') printOnOneLineString
equals: '''this is a test'''.

self
assert: ('this is a', Character lf asString, 'test') printOnOneLineString
equals: '''this is a test'''.

]

{ #category : #'tests-printing' }
ObjectTest >> testPrintString [

Expand Down
24 changes: 0 additions & 24 deletions src/Kernel/Object.class.st
Expand Up @@ -1703,30 +1703,6 @@ Object >> printOn: aStream [
nextPutAll: title
]

{ #category : #printing }
Object >> printOnOneLine: aStream [
"Append to the argument, aStream, a sequence of characters that
identifies the receiver, while replacing cr and lf with one space.
This is usually called by #printOnOneLineString with a filtering
stream, replacing cr and lf with spaces"

self printOn: aStream.
]

{ #category : #printing }
Object >> printOnOneLineString [
"Answer a String whose characters are a description of the receiver,
avoiding printing cr and lf"

|spaces filter|
spaces := { Character cr. Character lf }.
filter := FilteringStream on: String new writeStream with: [ :c |
(spaces includes: c) ifTrue:[ Character space ] ifFalse:[c] ].
self printOnOneLine: filter.
^ filter contents
]

{ #category : #printing }
Object >> printString [
"Answer a String whose characters are a description of the receiver.
Expand Down

0 comments on commit 9139515

Please sign in to comment.