The Trunk: CollectionsTests-ul.103.mcz

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

The Trunk: CollectionsTests-ul.103.mcz

commits-2
Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ul.103.mcz

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

Name: CollectionsTests-ul.103
Author: ul
Time: 13 October 2009, 1:24:34 am
UUID: 147381f0-d6ad-1944-9161-e80548af6cf1
Ancestors: CollectionsTests-nice.102

tests for String >> #format: and String >> #withBlanksTrimmed

=============== Diff against CollectionsTests-nice.102 ===============

Item was added:
+ ----- Method: StringTest>>testFormat (in category 'testing - formatting') -----
+ testFormat
+
+ {
+ [ '\{ \} \\ foo {1} bar {2}' format: { 12. 'string' } ] -> '{ } \ foo 12 bar string'.
+ [ '\{ \} \\ foo {2} bar {1}' format: { 'string'. 12 } ] -> '{ } \ foo 12 bar string'.
+ [ '\{1}' format: {} ] -> '{1}'.
+ [ '\{1}{1}' format: { $a } ] -> '{1}a'.
+ } do: [ :each |
+ self assert: each key value = each value ]!

Item was added:
+ ----- Method: StringTest>>testWithBlanksTrimmed (in category 'testing - converting') -----
+ testWithBlanksTrimmed
+
+ | s |
+ self assert: ' abc  d   ' withBlanksTrimmed = 'abc  d'.
+ self assert: 'abc  d   ' withBlanksTrimmed = 'abc  d'.
+ self assert: ' abc  d' withBlanksTrimmed = 'abc  d'.
+ self assert: (((0 to: 255) collect: [ :each | each asCharacter ] thenSelect: [ :each | each isSeparator ]) as: String) withBlanksTrimmed = ''.
+ s := 'abcd'.
+ self assert: s withBlanksTrimmed = s.
+ self assert: s withBlanksTrimmed ~~ s.!