1 RegressionTests addPrototype: #WordCount derivedFrom: {TestCase}.
2 "A regression test playing with the LICENSE file"
4 t@(RegressionTests WordCount traits) testFileName
9 t@(RegressionTests WordCount traits) testWordCount
12 (File newNamed: t testFileName &mode: File Read) sessionDo:
14 file reader split >> words writer.
16 "Console ; 'Number of different words ' ; (words size as: String) ; '\n'."
17 t assert: words size = 170 description: 'The number of words found in the LICENSE file is not as expected.'.
20 t@(RegressionTests WordCount traits) testLineCount
21 "Note that empty lines will be ignored by #splitWith: "
24 (File newNamed: t testFileName &mode: File Read) sessionDo:
26 (file reader splitWith: { $\n }) do:
27 [| :line | lineCount: lineCount succ].
29 "Console ; 'Number of lines ' ; (lineCount as: String) ; '\n'."
30 t assert: lineCount = 16 description: 'The number of lines found in the LICENSE file is not as expected.'.
33 t@(RegressionTests WordCount traits) suite
34 [t suiteForSelectors: {