The Trunk: WebClient-Tests-topa.51.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: WebClient-Tests-topa.51.mcz

commits-2
Tobias Pape uploaded a new version of WebClient-Tests to project The Trunk:
http://source.squeak.org/trunk/WebClient-Tests-topa.51.mcz

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

Name: WebClient-Tests-topa.51
Author: topa
Time: 3 July 2017, 5:27:47.053581 pm
UUID: ff869e77-50d0-4379-af4e-af233785ee01
Ancestors: WebClient-Tests-topa.50

Make sure WebMessage>>getContent respects charset.

=============== Diff against WebClient-Tests-topa.50 ===============

Item was added:
+ ----- Method: WebClientServerTest>>testContentEncoding (in category 'tests - misc') -----
+ testContentEncoding
+ "Test encoding detection"
+ | resp expected |
+ expected := '«garçon Léon»'.
+ #(
+ 'latin-1' #[171 103  97 114 231 111 110  32  76 233 111 110 187]
+ 'macroman' #[199 103  97 114 141 111 110  32  76 142 111 110 200]
+ 'utf-8' #[194 171 103  97 114 195 167 111 110  32  76 195 169 111 110 194 187]
+ ) pairsDo: [:name :bytes |
+ server addService: '/testcontent', name action:[:req|req send200Response: bytes asString contentType: 'text/plain; charset=', name].
+ resp := WebClient httpGet: self localHostUrl, '/testcontent', name.
+ self assert: 200 equals: resp code.
+ self assert: expected equals: resp content].
+ !