Christoph Thiede uploaded a new version of CollectionsTests to project The Trunk: http://source.squeak.org/trunk/CollectionsTests-ct.395.mcz
==================== Summary ====================
Name: CollectionsTests-ct.395 Author: ct Time: 22 May 2023, 2:24:30.353446 pm UUID: b9a99b6b-3dc7-0d46-a359-e5707a4f58d4 Ancestors: CollectionsTests-mt.394
Makes HtmlReadWriterTest>>#test16ImgTag scale-factor-aware. Thanks to Marcel for the hint!
=============== Diff against CollectionsTests-mt.394 ===============
Item was changed: ----- Method: HtmlReadWriterTest>>test16ImgTag (in category 'tests') ----- test16ImgTag <timeout: 10>
+ | imgUrl imgExpression formFromUrl formFromExpression placeholderForm | - | imgUrl imgExpression formFromUrl formFromExpression | imgUrl := 'https://squeak.org/img/downloads/image.png'. imgExpression := 'Form dotOfSize: 12@12 color: Color green'. self ensureSecureInternetConnection. formFromUrl := (Smalltalk classNamed: 'WebClient') ifNotNil: [:client | Form fromBinaryStream: (client httpGet: imgUrl) content asByteArray readStream]. formFromExpression := Compiler evaluate: imgExpression. + placeholderForm := readWriter imagePlaceholder. + RealEstateAgent scaleFactor = 1.0 ifFalse: [ formFromUrl := formFromUrl scaledToSize: (formFromUrl extent * RealEstateAgent scaleFactor). + formFromExpression := formFromExpression scaledToSize: (formFromExpression extent * RealEstateAgent scaleFactor). + placeholderForm := placeholderForm scaledToSize: (placeholderForm extent * RealEstateAgent scaleFactor)]. - formFromExpression := formFromExpression scaledToSize: (formFromExpression extent * RealEstateAgent scaleFactor)]. ({ []. imgUrl. formFromUrl. + []. 'fantasy:wonderland/alice'. placeholderForm. - []. 'fantasy:wonderland/alice'. readWriter imagePlaceholder. []. 'code://' , imgExpression. formFromExpression. + []. 'code://Object'. placeholderForm. + []. 'code://' , imgExpression , ';'. placeholderForm. - []. 'code://Object'. readWriter imagePlaceholder. - []. 'code://' , imgExpression , ';'. readWriter imagePlaceholder. + [readWriter shallDownloadResources: false]. imgUrl. placeholderForm. - [readWriter shallDownloadResources: false]. imgUrl. readWriter imagePlaceholder. + [readWriter shallEvaluateResources: false]. 'code://' , imgExpression. placeholderForm. - [readWriter shallEvaluateResources: false]. 'code://' , imgExpression. readWriter imagePlaceholder. } groupsCollect: [:prepareBlock :src :expectedForm | { 'Hello <img src="{1}"> World' format: { src }. ('Hello {1} World' format: { Character startOfHeader }) asText addAttribute: expectedForm asTextAnchor from: 7 to: 7; addAttribute: (TextColor color: Color transparent) from: 7 to: 7. prepareBlock}]) , ({ "different closing tag styles" 'Hello <img src="code://{1}"></img> World' format: { imgExpression }. ('Hello {1} World' format: { Character startOfHeader }) asText addAttribute: formFromExpression asTextAnchor from: 7 to: 7; addAttribute: (TextColor color: Color transparent) from: 7 to: 7. 'Hello <img src="code://{1}"/> World' format: { imgExpression }. ('Hello {1} World' format: { Character startOfHeader }) asText addAttribute: formFromExpression asTextAnchor from: 7 to: 7; addAttribute: (TextColor color: Color transparent) from: 7 to: 7. "case, spaces, escape sequence" 'Hello <IMG SRC = "code://{1}"> World' format: { imgExpression }. ('Hello {1} World' format: { Character startOfHeader }) asText addAttribute: formFromExpression asTextAnchor from: 7 to: 7; addAttribute: (TextColor color: Color transparent) from: 7 to: 7. "leading and trailing images" '<img src="code://{1}"> squeak <img src="code://{1}">' format: { imgExpression }. ('{1} squeak {1}' format: { Character startOfHeader }) asText addAttribute: formFromExpression asTextAnchor from: 1 to: 1; addAttribute: (TextColor color: Color transparent) from: 1 to: 1; addAttribute: formFromExpression asTextAnchor from: 10 to: 10; addAttribute: (TextColor color: Color transparent) from: 10 to: 10. + } pairsCollect: [:a :b | {a. b}]) + + collect: [:spec | - - } pairsCollect: [:a :b | {a. b}]) collect: [:spec | | givenHtml expectedText prepareBlock | givenHtml := spec first. expectedText := spec second. prepareBlock := spec at: 3 ifAbsent: []. self setUpReadWriter. prepareBlock value. self convertHtml: givenHtml. self assert: expectedText string equals: text string. expectedText runs with: text runs do: [:expectedAttributes :actualAttributes | expectedAttributes with: actualAttributes do: [:expectedAttribute :actualAttribute | self assert: (expectedAttribute = actualAttribute or: [ ((expectedAttribute respondsTo: #anchoredMorph) and: [actualAttribute respondsTo: #anchoredMorph]) and: [(expectedAttribute anchoredMorph "aForm" unhibernate; bits) = (actualAttribute anchoredMorph "aForm" unhibernate; bits)] ]) ]]].!
packages@lists.squeakfoundation.org