Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Toplo-Serialization-Stash/ToLabel.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ Extension { #name : #ToLabel }
ToLabel >> stashAccessorsForText [

<stashAccessors>
^ { #text }
| accessors |
accessors := OrderedCollection with: #text.
self isMultiLine ifTrue:[
accessors add: #multiLine: -> #isMultiLine
].
^ accessors
]
25 changes: 24 additions & 1 deletion src/Toplo-Serialization-Tests/ToSerializerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,30 @@ ToSerializerTest >> testToLabel [

self
test: origin
on: [ :element | self assert: element text asString equals: 'hello' ]
on: [ :element |
self assert: element text asString equals: 'hello'.
].

]

{ #category : #tests }
ToSerializerTest >> testToLabelMultiLine [

| origin |
origin := ToLabel new text: 'hello' asRopedText; yourself.
origin beMultiLine.
self
test: origin
on: [ :element |
self assert: element isMultiLine
].
origin beMonoLine.
self
test: origin
on: [ :element |
self deny: element isMultiLine
].

]

{ #category : #tests }
Expand Down
Loading