File tree Expand file tree Collapse file tree
Toplo-Serialization-Stash
Toplo-Serialization-Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,5 +4,10 @@ Extension { #name : #ToLabel }
44ToLabel >> stashAccessorsForText [
55
66 < stashAccessors>
7- ^ { #text }
7+ | accessors |
8+ accessors := OrderedCollection with: #text .
9+ self isMultiLine ifTrue: [
10+ accessors add: #multiLine: - > #isMultiLine
11+ ].
12+ ^ accessors
813]
Original file line number Diff line number Diff line change @@ -374,7 +374,30 @@ ToSerializerTest >> testToLabel [
374374
375375 self
376376 test: origin
377- on: [ :element | self assert: element text asString equals: ' hello' ]
377+ on: [ :element |
378+ self assert: element text asString equals: ' hello' .
379+ ].
380+
381+ ]
382+
383+ { #category : #tests }
384+ ToSerializerTest >> testToLabelMultiLine [
385+
386+ | origin |
387+ origin := ToLabel new text: ' hello' asRopedText; yourself .
388+ origin beMultiLine.
389+ self
390+ test: origin
391+ on: [ :element |
392+ self assert: element isMultiLine
393+ ].
394+ origin beMonoLine.
395+ self
396+ test: origin
397+ on: [ :element |
398+ self deny: element isMultiLine
399+ ].
400+
378401]
379402
380403{ #category : #tests }
You can’t perform that action at this time.
0 commit comments