Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
]
8 changes: 6 additions & 2 deletions src/Toplo-Serialization-Tests/ToSerializerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,14 @@ ToSerializerTest >> testToLabel [

| origin |
origin := ToLabel new text: 'hello' asRopedText; yourself.

origin beMultiLine.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would create 2 test methods.

It would be easier to debug in the future if each test only focus on one specific aspect of the serialization.

One test for the "text", one test for the "multiline"

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

]

{ #category : #tests }
Expand Down
Loading