Marcel Taeumel uploaded a new version of CollectionsTests to project The Trunk: http://source.squeak.org/trunk/CollectionsTests-mt.400.mcz
==================== Summary ====================
Name: CollectionsTests-mt.400 Author: mt Time: 14 September 2023, 4:59:34.513231 pm UUID: 5252ed4b-a931-1e41-b067-28f86244d942 Ancestors: CollectionsTests-mt.399
Complements Collections-mt.1050
=============== Diff against CollectionsTests-mt.399 ===============
Item was added: + ----- Method: TextTest>>test09AddAttributeFromToChecking (in category 'tests') ----- + test09AddAttributeFromToChecking + + | attribute | + attribute := TextEmphasis bold. + + #( + 'abc' -5 10 "negative start, stop behind end of content" + 'abc' 10 15 "both start and stop behind end of content" + 'abc' 2 1 "start behind stop" + 'abc' 15 10 "start behind stop and both behind content" + 'abc' 10 1 "start behind stop and start behind content" + '' 1 2 "empty string" + ) groupsDo: [:content :start :stop | + | text | + text := Text fromString: content. + text addAttribute: attribute from: start to: stop. + self assert: text size equals: text runs size].!
Item was added: + ----- Method: TextTest>>test10RemoveAttributeFromToChecking (in category 'tests') ----- + test10RemoveAttributeFromToChecking + + | attribute | + attribute := TextEmphasis bold. + + #( + 'abc' -5 10 "negative start, stop behind end of content" + 'abc' 10 15 "both start and stop behind end of content" + 'abc' 2 1 "start behind stop" + 'abc' 15 10 "start behind stop and both behind content" + 'abc' 10 1 "start behind stop and start behind content" + '' 1 2 "empty string" + ) groupsDo: [:content :start :stop | + | text | + text := Text string: content attribute: attribute. + text removeAttribute: attribute from: start to: stop. + self assert: text size equals: text runs size].!
Item was changed: + ----- Method: TextTest>>testLineCorrespondingToIndex (in category 'tests - lines') ----- - ----- Method: TextTest>>testLineCorrespondingToIndex (in category 'tests -lines ') ----- testLineCorrespondingToIndex
| sampleText | sampleText := '<i>F<b>red<br>t</b>he<br><u>Bear</u></i>' asTextFromHtml. self flag: #forLater. "do not re- and enable common attributes in HtmlReadWriter" self assert: '<i><b>t</b></i><i>he</i>' equals: (sampleText lineCorrespondingToIndex: (sampleText indexOf: $h)) printHtmlString. self assert: '<i><u>Bear</u></i>' equals: (sampleText lineCorrespondingToIndex: (sampleText indexOf: $B)) printHtmlString. self assert: '<i>F</i><i><b>red</b></i>' equals: (sampleText lineCorrespondingToIndex: (sampleText indexOf: $d)) printHtmlString.!
Item was changed: + ----- Method: TextTest>>testLineCount (in category 'tests - lines') ----- - ----- Method: TextTest>>testLineCount (in category 'tests -lines ') ----- testLineCount
| sampleText | sampleText := '<i>F<b>red<br>t</b>he<br><u>Bear</u></i>' asTextFromHtml. self assert: 3 equals: sampleText lineCount.!
Item was changed: + ----- Method: TextTest>>testLineNumber (in category 'tests - lines') ----- - ----- Method: TextTest>>testLineNumber (in category 'tests -lines ') ----- testLineNumber
| sampleText | sampleText := '<i>F<b>red<br>t</b>he<br><u>Bear</u></i>' asTextFromHtml. self flag: #forLater. "do not re- and enable common attributes in HtmlReadWriter" self assert: '<i><b>t</b></i><i>he</i>' equals: (sampleText lineNumber: 2) printHtmlString.!
Item was changed: + ----- Method: TextTest>>testLines (in category 'tests - lines') ----- - ----- Method: TextTest>>testLines (in category 'tests -lines ') ----- testLines
| html text lines | html := '<u>F<b>red</b>', String cr , '<i>the' , String lf , 'Bear</i>'. text := (HtmlReadWriter on: html readStream) breakLines: false; nextText. lines := text lines. self assert: (#('F<b>red</b>' '<i>the</i>' '<i>Bear</i>') collect: #asTextFromHtml) equals: lines.!
squeak-dev@lists.squeakfoundation.org