Skip to content

Commit c91dbcf

Browse files
author
Dean Wampler
committed
Improved a test for ticket #43
1 parent 3f40774 commit c91dbcf

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/test/scala/progscala3/forcomps/RemoveBlanksSuite.scala

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,27 @@ class RemoveBlanksSuite extends FunSuite:
88

99
test("RemoveBlanks removes blank lines in text") {
1010
val lines = RemoveBlanks(path, compress = false, numbers = false)
11-
assert(lines.mkString("\n") ==
11+
val actual = lines.mkString("\n")
12+
val expected =
1213
""" This is a small
13-
|test file""".stripMargin)
14+
|test file""".stripMargin
15+
assert(actual == expected, s"""Actual:\n$actual\nExpected:\n$expected\n""")
1416
}
1517

1618
test("RemoveBlanks optionally compresses whitespace in text") {
1719
val lines = RemoveBlanks(path, compress = true, numbers = false)
18-
assert(lines.mkString("\n") ==
20+
val actual = lines.mkString("\n")
21+
val expected =
1922
"""This is a small
20-
|test file""".stripMargin)
23+
|test file""".stripMargin
24+
assert(actual == expected, s"""Actual:\n$actual\nExpected:\n$expected\n""")
2125
}
2226

2327
test("RemoveBlanks optionally prints line numbers from the original text") {
2428
val lines = RemoveBlanks(path, compress = true, numbers = true)
25-
assert(lines.mkString("\n") ==
29+
val actual = lines.mkString("\n")
30+
val expected =
2631
""" 1: This is a small
27-
| 3: test file""".stripMargin, lines.mkString("\n"))
32+
| 3: test file""".stripMargin
33+
assert(actual == expected, s"""Actual:\n$actual\nExpected:\n$expected\n""")
2834
}

0 commit comments

Comments
 (0)