[squeak-dev] The Trunk: CollectionsTests-dtl.209.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 4 01:13:00 UTC 2014


David T. Lewis uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-dtl.209.mcz

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

Name: CollectionsTests-dtl.209
Author: dtl
Time: 2 January 2014, 3:55:41.062 pm
UUID: 5681f129-af93-4f97-9449-b2391be6c8a3
Ancestors: CollectionsTests-fbs.208

Provide TextAttributesScanningTest to verify text attribute filein and fileout.

Five tests are marked as expected failures. These are tests for text attributes that are apparently unused, and that are likely candidates for removal from the image.

There is one failure in a test for PluggableTextAttribute, which is a kind of text attribute that is used by SqueakMap. This is probably a legitimate failure that should be fixed.

=============== Diff against CollectionsTests-fbs.208 ===============

Item was added:
+ TestCase subclass: #TextAttributesScanningTest
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'CollectionsTests-Text'!
+ 
+ !TextAttributesScanningTest commentStamp: '<historical>' prior: 0!
+ A TextAttributesTest verifies storing and reading text attributes in file out chunk format.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>expectedFailures (in category 'running') -----
+ expectedFailures
+ 	"Tests for text attributes that are apparently unused, and that may be candidates
+ 	for removal from the image"
+ 	^#(
+ 		testTextAnchor
+ 		testTextIndent
+ 		testTextMessageLink
+ 		testTextPlusJumpStart
+ 		testTextPlusJumpEnd
+ 		)!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testPluggableTextAttribute (in category 'testing') -----
+ testPluggableTextAttribute
+ 	| att strm |
+ 	att := PluggableTextAttribute evalBlock: [ #foo ].
+ 	strm := ReadWriteStream on: ''.
+ 	self assert: (att respondsTo: #writeScanOn:).
+ 	att writeScanOn: strm.
+ 	"FIXME: PluggableTextAttribute used by SqueakMap. Currently it cannot
+ 	be filed out, so this probably needs fixing. See RunArray class>>scanFrom:"
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testRunArrayScan (in category 'testing') -----
+ testRunArrayScan
+ 	| ra ra2 strm |
+ 	ra := RunArray scanFrom: (ReadStream on: '(14 50 312)f1,f1b,f1LInteger +;i').
+ 	strm := ReadWriteStream on: ''.
+ 	ra writeScanOn: strm.
+ 	strm reset.
+ 	ra2 := RunArray scanFrom: strm.
+ 	self assert: ra2 equals: ra
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextAction (in category 'testing') -----
+ testTextAction
+ 	self assert: true
+ 		description: 'TextAction is abstract and does not need to support text filein and fileout'.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextAlignment (in category 'testing') -----
+ testTextAlignment
+ 	| att strm att2 identifierCharacter att3 att4 |
+ 	att := TextAlignment leftFlush.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $a.
+ 	att2 :=TextAlignment new alignment: (Integer readFrom: strm ifFail: [-1]).
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $a) equals: TextAlignment.
+ 
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $a.
+ 	att3 := TextAlignment scanFrom: strm.
+ 	self assert: att equals: att3.
+ 	self assert: (TextAttribute classFor: $a) equals: TextAlignment.
+ 
+ 	strm reset.
+ 	att4 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att4.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextAnchor (in category 'testing') -----
+ testTextAnchor
+ 	| att strm |
+ 	att := TextAnchor new anchoredMorph: RectangleMorph new initialize.
+ 	strm := ReadWriteStream on: ''.
+ 	self assert: (att respondsTo: #writeScanOn:).
+ 	att writeScanOn: strm. "FIXME - is TextAnchor used for anything?"
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextAttributeClassFor (in category 'testing') -----
+ testTextAttributeClassFor
+ 	"Verify class identifiers as used in RunArray class>>scanFrom:"
+ 
+ 	self assert: (TextAttribute classFor: $a) equals: TextAlignment.
+ 	self assert: (TextAttribute classFor: $f) equals: TextFontChange.
+ 	self assert: (TextAttribute classFor: $F) equals: TextFontReference.
+ 	self assert: (TextAttribute classFor: $b) equals: TextEmphasis.
+ 	self assert: (TextAttribute classFor: $i) equals: TextEmphasis.
+ 	self assert: (TextAttribute classFor: $u) equals: TextEmphasis.
+ 	self assert: (TextAttribute classFor: $=) equals: TextEmphasis.
+ 	self assert: (TextAttribute classFor: $n) equals: TextEmphasis.
+ 	self assert: (TextAttribute classFor: $-) equals: TextKern.
+ 	self assert: (TextAttribute classFor: $+) equals: TextKern.
+ 	self assert: (TextAttribute classFor: $c) equals: TextColor.
+ 	self assert: (TextAttribute classFor: $L) equals: TextLink.
+ 	self assert: (TextAttribute classFor: $R) equals: TextURL.
+ 	self assert: (TextAttribute classFor: $q) equals: TextSqkPageLink.
+ 	self assert: (TextAttribute classFor: $p) equals: TextSqkProjectLink.
+ 	self assert: (TextAttribute classFor: $P) equals: TextPrintIt.
+ 	self assert: (TextAttribute classFor: $d) equals: TextDoIt.
+ 
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextColor (in category 'testing') -----
+ testTextColor
+ 	| att strm att2 att3 identifierCharacter |
+ 	att := TextColor color: Color red.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $c.
+ 	att2 := TextColor scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $c) equals: TextColor.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextDoIt (in category 'testing') -----
+ testTextDoIt
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextDoIt evalString: 'foo'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $d.
+ 	att2 := TextDoIt scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $d) equals: TextDoIt.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextEmphasisBold (in category 'testing') -----
+ testTextEmphasisBold
+ 	| att strm identifierCharacter att3 |
+ 	att := TextEmphasis bold.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $b.
+ 	self assert: strm atEnd.
+ 	self assert: (TextAttribute classFor: $b) equals: TextEmphasis.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextEmphasisItalic (in category 'testing') -----
+ testTextEmphasisItalic
+ 	| att strm identifierCharacter att3 |
+ 	att := TextEmphasis italic.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $i.
+ 	self assert: strm atEnd.
+ 	self assert: (TextAttribute classFor: $i) equals: TextEmphasis.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextEmphasisNormal (in category 'testing') -----
+ testTextEmphasisNormal
+ 	| att strm identifierCharacter att3 |
+ 	att := TextEmphasis normal.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $n.
+ 	self assert: strm atEnd.
+ 	self assert: (TextAttribute classFor: $n) equals: TextEmphasis.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextEmphasisStruckOut (in category 'testing') -----
+ testTextEmphasisStruckOut
+ 	| att strm identifierCharacter att3 |
+ 	att := TextEmphasis struckOut.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $=.
+ 	self assert: strm atEnd.
+ 	self assert: (TextAttribute classFor: $=) equals: TextEmphasis.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextEmphasisUnderlined (in category 'testing') -----
+ testTextEmphasisUnderlined
+ 	| att strm identifierCharacter att3 |
+ 	att := TextEmphasis underlined.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $u.
+ 	self assert: strm atEnd.
+ 	self assert: (TextAttribute classFor: $u) equals: TextEmphasis.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextFontChange (in category 'testing') -----
+ testTextFontChange
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextFontChange font3.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $f.
+ 	att2 := TextFontChange new fontNumber: (Integer readFrom: strm ifFail: [0]).
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $f) equals: TextFontChange.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextFontReference (in category 'testing') -----
+ testTextFontReference
+ 	| font att strm identifierCharacter fontReferenceString att3 |
+ 	font := StrikeFont someInstance.
+ 	att := TextFontReference toFont: font.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $F.
+ 	fontReferenceString := strm upToEnd.
+ 	self assert: fontReferenceString equals: font familyName, '#', font height.
+ 	self assert: (TextAttribute classFor: $F) equals: TextFontReference.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextIndent (in category 'testing') -----
+ testTextIndent
+ 	"TextIndent is unused and does not have in implemention to support text
+ 	filein and fileout. See TextAlignment for its likely replacement."
+ 	self fail: 'TextIndent is apparently unused'!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextKern (in category 'testing') -----
+ testTextKern
+ 	| att strm att2 att3 |
+ 
+ 	att := TextKern kern: 5.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	5 timesRepeat: [self assert: strm next equals: $+].
+ 	self assert: strm atEnd.
+ 	strm reset.
+ 	att2 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att2.
+ 
+ 	att := TextKern kern: -5.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	5 timesRepeat: [self assert: strm next equals: $-].
+ 	self assert: strm atEnd.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextLink (in category 'testing') -----
+ testTextLink
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextLink new classAndMethod: 'class and method string'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $L.
+ 	att2 := TextLink scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $L) equals: TextLink.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextMessageLink (in category 'testing') -----
+ testTextMessageLink
+ 	| att strm |
+ 	att := TextMessageLink message: Message someInstance.
+ 	strm := ReadWriteStream on: ''.
+ 	self assert: (att respondsTo: #writeScanOn:).
+ 	att writeScanOn: strm. "FIXME - is TextMessageLink used for anything?"
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextPlusJumpEnd (in category 'testing') -----
+ testTextPlusJumpEnd
+ 	| att strm |
+ 	att := TextPlusJumpEnd new jumpLabel: 'this is a jump label'.
+ 	strm := ReadWriteStream on: ''.
+ 	self assert: (att respondsTo: #writeScanOn:).
+ 	att writeScanOn: strm. "FIXME - is TextPlusJumpEnd used for anything?"
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextPlusJumpStart (in category 'testing') -----
+ testTextPlusJumpStart
+ 	| att strm |
+ 	att := TextPlusJumpStart new jumpLabel: 'this is a jump label'.
+ 	strm := ReadWriteStream on: ''.
+ 	self assert: (att respondsTo: #writeScanOn:).
+ 	att writeScanOn: strm. "FIXME - is TextPlusJumpStart used for anything?"
+ !

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextPrintIt (in category 'testing') -----
+ testTextPrintIt
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextPrintIt evalString: 'foo'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $P.
+ 	att2 := TextPrintIt scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $P) equals: TextPrintIt.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextSqkPageLink (in category 'testing') -----
+ testTextSqkPageLink
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextSqkPageLink new url: 'a URL string'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $q.
+ 	att2 := TextSqkPageLink scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $q) equals: TextSqkPageLink.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextSqkProjectLink (in category 'testing') -----
+ testTextSqkProjectLink
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextSqkProjectLink new url: 'a URL string'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $p.
+ 	att2 := TextSqkProjectLink scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $p) equals: TextSqkProjectLink.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!

Item was added:
+ ----- Method: TextAttributesScanningTest>>testTextURL (in category 'testing') -----
+ testTextURL
+ 	| att strm att2 identifierCharacter att3 |
+ 	att := TextURL new url: 'a URL string'.
+ 	strm := ReadWriteStream on: ''.
+ 	att writeScanOn: strm.
+ 	strm reset.
+ 	identifierCharacter := strm next.
+ 	self assert: identifierCharacter equals: $R.
+ 	att2 := TextURL scanFrom: strm.
+ 	self assert: att equals: att2.
+ 	self assert: (TextAttribute classFor: $R) equals: TextURL.
+ 	strm reset.
+ 	att3 := TextAttribute newFrom: strm.
+ 	self assert: att equals: att3.!



More information about the Squeak-dev mailing list