David T. Lewis uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-dtl.210.mcz ==================== Summary ==================== Name: CollectionsTests-dtl.210 Author: dtl Time: 5 January 2014, 1:14:57.588 pm UUID: 7da92d9b-dda5-4553-9222-8d0efc5c0590 Ancestors: CollectionsTests-dtl.209 Change usage of assert:equals: so that expected value comes first. =============== Diff against CollectionsTests-dtl.209 =============== Item was changed: ----- 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: ra equals: ra2 - self assert: ra2 equals: ra ! Item was changed: ----- 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: $a equals: identifierCharacter. - 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: $a equals: identifierCharacter. - self assert: identifierCharacter equals: $a. att3 := TextAlignment scanFrom: strm. self assert: att equals: att3. + self assert: TextAlignment equals: (TextAttribute classFor: $a). - self assert: (TextAttribute classFor: $a) equals: TextAlignment. strm reset. att4 := TextAttribute newFrom: strm. self assert: att equals: att4.! Item was changed: ----- Method: TextAttributesScanningTest>>testTextAttributeClassFor (in category 'testing') ----- testTextAttributeClassFor "Verify class identifiers as used in RunArray class>>scanFrom:" + self assert: TextAlignment equals: (TextAttribute classFor: $a). + self assert: TextFontChange equals: (TextAttribute classFor: $f). + self assert: TextFontReference equals: (TextAttribute classFor: $F). + self assert: TextEmphasis equals: (TextAttribute classFor: $b). + self assert: TextEmphasis equals: (TextAttribute classFor: $i). + self assert: TextEmphasis equals: (TextAttribute classFor: $u). + self assert: TextEmphasis equals: (TextAttribute classFor: $=). + self assert: TextEmphasis equals: (TextAttribute classFor: $n). + self assert: TextKern equals: (TextAttribute classFor: $-). + self assert: TextKern equals: (TextAttribute classFor: $+). + self assert: TextColor equals: (TextAttribute classFor: $c). + self assert: TextLink equals: (TextAttribute classFor: $L). + self assert: TextURL equals: (TextAttribute classFor: $R). + self assert: TextSqkPageLink equals: (TextAttribute classFor: $q). + self assert: TextSqkProjectLink equals: (TextAttribute classFor: $p). + self assert: TextPrintIt equals: (TextAttribute classFor: $P). + self assert: TextDoIt equals: (TextAttribute classFor: $d). - 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 changed: ----- 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: $c equals: identifierCharacter. - self assert: identifierCharacter equals: $c. att2 := TextColor scanFrom: strm. self assert: att equals: att2. + self assert: TextColor equals: (TextAttribute classFor: $c). - self assert: (TextAttribute classFor: $c) equals: TextColor. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $b equals: identifierCharacter. - self assert: identifierCharacter equals: $b. self assert: strm atEnd. self assert: (TextAttribute classFor: $b) equals: TextEmphasis. + self assert: TextEmphasis equals: (TextAttribute classFor: $b). strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $i equals: identifierCharacter. - self assert: identifierCharacter equals: $i. self assert: strm atEnd. + self assert: TextEmphasis equals: (TextAttribute classFor: $i). - self assert: (TextAttribute classFor: $i) equals: TextEmphasis. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $n equals: identifierCharacter. - self assert: identifierCharacter equals: $n. self assert: strm atEnd. + self assert: TextEmphasis equals: (TextAttribute classFor: $n). - self assert: (TextAttribute classFor: $n) equals: TextEmphasis. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $= equals: identifierCharacter. - self assert: identifierCharacter equals: $=. self assert: strm atEnd. self assert: (TextAttribute classFor: $=) equals: TextEmphasis. + self assert: TextEmphasis equals: (TextAttribute classFor: $= ). strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $u equals: identifierCharacter. - self assert: identifierCharacter equals: $u. self assert: strm atEnd. + self assert: TextEmphasis equals: (TextAttribute classFor: $u). - self assert: (TextAttribute classFor: $u) equals: TextEmphasis. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3. ! Item was changed: ----- 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: $f equals: identifierCharacter. - self assert: identifierCharacter equals: $f. att2 := TextFontChange new fontNumber: (Integer readFrom: strm ifFail: [0]). self assert: att equals: att2. + self assert: TextFontChange equals: (TextAttribute classFor: $f). - self assert: (TextAttribute classFor: $f) equals: TextFontChange. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $F equals: identifierCharacter. - self assert: identifierCharacter equals: $F. fontReferenceString := strm upToEnd. + self assert: font familyName, '#', font height equals: fontReferenceString. + self assert: TextFontReference equals: (TextAttribute classFor: $F). - 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 changed: ----- 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: $+ equals: strm next]. - 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: $- equals: strm next]. - 5 timesRepeat: [self assert: strm next equals: $-]. self assert: strm atEnd. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $L equals: identifierCharacter. - self assert: identifierCharacter equals: $L. att2 := TextLink scanFrom: strm. self assert: att equals: att2. + self assert: TextLink equals: (TextAttribute classFor: $L). - self assert: (TextAttribute classFor: $L) equals: TextLink. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $P equals: identifierCharacter. - self assert: identifierCharacter equals: $P. att2 := TextPrintIt scanFrom: strm. self assert: att equals: att2. + self assert: TextPrintIt equals: (TextAttribute classFor: $P). - self assert: (TextAttribute classFor: $P) equals: TextPrintIt. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $q equals: identifierCharacter. - self assert: identifierCharacter equals: $q. att2 := TextSqkPageLink scanFrom: strm. self assert: att equals: att2. + self assert: TextSqkPageLink equals: (TextAttribute classFor: $q). - self assert: (TextAttribute classFor: $q) equals: TextSqkPageLink. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $p equals: identifierCharacter. - self assert: identifierCharacter equals: $p. att2 := TextSqkProjectLink scanFrom: strm. self assert: att equals: att2. + self assert: TextSqkProjectLink equals: (TextAttribute classFor: $p). - self assert: (TextAttribute classFor: $p) equals: TextSqkProjectLink. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! Item was changed: ----- 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: $R equals: identifierCharacter. - self assert: identifierCharacter equals: $R. att2 := TextURL scanFrom: strm. self assert: att equals: att2. + self assert: TextURL equals: (TextAttribute classFor: $R). - self assert: (TextAttribute classFor: $R) equals: TextURL. strm reset. att3 := TextAttribute newFrom: strm. self assert: att equals: att3.! |
Free forum by Nabble | Edit this page |