The Trunk: CollectionsTests-nice.112.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-nice.112.mcz

commits-2
Nicolas Cellier uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-nice.112.mcz

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

Name: CollectionsTests-nice.112
Author: nice
Time: 16 November 2009, 9:39:08 am
UUID: 14c3918f-73ec-4aa1-9dde-cf46d5b6e056
Ancestors: CollectionsTests-nice.111

Test #withNoLineLongerThan:

=============== Diff against CollectionsTests-nice.111 ===============

Item was added:
+ ----- Method: StringTest>>testWthNoLineLongerThan (in category 'testing - lines') -----
+ testWthNoLineLongerThan
+ | phrases |
+ phrases := {
+ 'Fred the bear went down to the brook to read his book in silence'.
+ 'Fred the bear went down' , String cr , ' to the brook to ' , String cr , 'read his book in silence'.
+ 'Fred the bear went down' , String lf , '  to the brook to ' , String lf , 'read his book in silence'.
+ 'Fred the bear went down' , String crlf , '  to the brook to ' , String crlf , 'read his book in silence'.
+ }.
+ #(5 7 9) do: [:length |
+ phrases do: [:phrase |
+ | split |
+ split := phrase withNoLineLongerThan: length.
+ self
+ assert: (split copyWithoutAll: CharacterSet separators) = (phrase copyWithoutAll: CharacterSet separators)
+ description: 'no information should be lost'.
+ split linesDo: [:line |
+ self assert: line size <= length description: 'lines should not be longer than prescribed']]]!