Skip to content

Commit 2ceeba2

Browse files
committed
assertions should be more robust to fluctuations in whitespace
1 parent 5c50e31 commit 2ceeba2

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

analysis/src/test/scala/org/polystat/odin/analysis/inlining/InliningTests.scala

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import org.polystat.odin.parser.eo.Parser
66
import SetLocatorsTestCases._
77
import InlineCallsTestCases._
88
import cats.syntax.either._
9-
import cats.data.{EitherNel, NonEmptyList => Nel}
9+
import cats.syntax.foldable._
10+
import cats.data.{NonEmptyList => Nel}
1011

1112
class InliningTests extends munit.FunSuite {
1213

@@ -18,14 +19,18 @@ class InliningTests extends munit.FunSuite {
1819

1920
locatorTests.foreach { case LocatorTestCase(label, before, after) =>
2021
test("setLocators - " + label) {
21-
val expected: EitherNel[String, String] = after
22-
val obtained: EitherNel[String, String] = Parser
22+
val expected = after
23+
.leftMap(_.mkString_(util.Properties.lineSeparator))
24+
.merge
25+
val obtained = Parser
2326
.parse(before)
2427
.leftMap(Nel.one)
2528
.flatMap(Context.setLocators)
2629
.map(_.toEOPretty)
30+
.leftMap(_.mkString_(util.Properties.lineSeparator))
31+
.merge
2732

28-
assertEquals(obtained, expected)
33+
assertNoDiff(obtained, expected)
2934
}
3035
}
3136

@@ -46,13 +51,17 @@ class InliningTests extends munit.FunSuite {
4651
inliningTests.foreach { case InliningTestCase(label, before, after) =>
4752
test("inlineAllCalls - " + label) {
4853
val expected = after
54+
.leftMap(_.mkString_(util.Properties.lineSeparator))
55+
.merge
4956
val obtained = Parser
5057
.parse(before)
5158
.leftMap(Nel.one)
5259
.flatMap(Inliner.inlineAllCalls)
5360
.map(_.toEOPretty)
61+
.leftMap(_.mkString_(util.Properties.lineSeparator))
62+
.merge
5463

55-
assertEquals(obtained, expected)
64+
assertNoDiff(obtained, expected)
5665

5766
}
5867
}

0 commit comments

Comments
 (0)