[squeak-dev] The Trunk: MultilingualTests-tpr.19.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 20 01:59:20 UTC 2016


tim Rowledge uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-tpr.19.mcz

==================== Summary ====================

Name: MultilingualTests-tpr.19
Author: tpr
Time: 20 January 2016, 5:59:14.555529 pm
UUID: b2182a04-860d-4137-a68e-89b4502e581d
Ancestors: MultilingualTests-fbs.18

Fix a failing test - when formatting NewParagraphs the caretWidth is added to the width required by the actual included text. The test needs to allow for that

=============== Diff against MultilingualTests-fbs.18 ===============

Item was changed:
  ----- Method: FontTest>>testParagraph (in category 'testing') -----
  testParagraph
  	"self debug: #testParagraph"
  	| text p style height width |
  	text := 'test' asText.
  	p := NewParagraph new.
  	style := TextStyle default.
  	p
  		compose: text
  		style: style
  		from: 1
  		in: (0 @ 0 corner: 100 @ 100).
  	"See CompositionScanner>>setActualFont: &  
  	CompositionScanner>>composeFrom:inRectangle:firstLine:leftSide:rightSide:"
  	height := style defaultFont height + style leading.
+ 	width := (text
- 	width := text
  				inject: 0
  				into: [:tally :next | tally
+ 						+ (style defaultFont widthOf: next)]) + p caretWidth. "because it is added by the paragraph formatting"
- 						+ (style defaultFont widthOf: next)].
  	p adjustRightX.
  	self assert: p extent = (width @ height)!



More information about the Squeak-dev mailing list