Christoph Thiede uploaded a new version of CollectionsTests to project The Trunk: http://source.squeak.org/trunk/CollectionsTests-ct.392.mcz
==================== Summary ====================
Name: CollectionsTests-ct.392 Author: ct Time: 20 May 2023, 6:14:26.941984 pm UUID: 01a2fb63-64dc-1e4c-9c58-42a38ec58898 Ancestors: CollectionsTests-ct.391
Complements Collections-ct.1038 (HtmlReadWriter permissions).
=============== Diff against CollectionsTests-ct.391 ===============
Item was changed: ----- Method: HtmlReadWriterTest>>test16ImgTag (in category 'tests') ----- test16ImgTag <timeout: 10>
| 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. RealEstateAgent scaleFactor = 1.0 ifFalse: [ formFromUrl := formFromUrl scaledToSize: (formFromUrl extent * RealEstateAgent scaleFactor). formFromExpression := formFromExpression scaledToSize: (formFromExpression extent * RealEstateAgent scaleFactor)]. ({ []. imgUrl. formFromUrl. []. 'fantasy:wonderland/alice'. readWriter imagePlaceholder. []. 'code://' , imgExpression. formFromExpression. []. 'code://Object'. readWriter imagePlaceholder. []. 'code://' , imgExpression , ';'. readWriter imagePlaceholder. + + [readWriter shallDownloadResources: false]. imgUrl. readWriter imagePlaceholder. + + [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}]) , ({ '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. '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. } pairsCollect: [:html :expectedText | {html. expectedText}]) collect: [:spec | | html expectedText prepareBlock | html := spec first. expectedText := spec second. prepareBlock := spec at: 3 ifAbsent: []. self setUpReadWriter. prepareBlock value. self convertHtml: html. 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