Skip to content

Commit c96750b

Browse files
Make DefaultTests more robust (#1613)
1 parent 10fa7d5 commit c96750b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/integration/src/test/scala/scala/cli/integration/DefaultTests.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
88
test("running scala-cli with no args should default to repl") {
99
TestInputs.empty.fromRoot { root =>
1010
val res = os.proc(TestUtil.cli, "--repl-dry-run").call(cwd = root, mergeErrIntoOut = true)
11-
expect(res.out.trim() == replDryRunOutput)
11+
expect(res.out.lines().lastOption.contains(replDryRunOutput))
1212
}
1313
}
1414
test("running scala-cli with no args should not accept run-only options") {
@@ -20,7 +20,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
2020
check = false
2121
)
2222
expect(res.exitCode == 1)
23-
expect(res.out.trim() == unrecognizedArgMessage(runSpecificOption))
23+
expect(res.out.lines().endsWith(unrecognizedArgMessage(runSpecificOption)))
2424
}
2525
}
2626
test("running scala-cli with args should not accept repl-only options") {
@@ -32,7 +32,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
3232
check = false
3333
)
3434
expect(res.exitCode == 1)
35-
expect(res.out.trim() == unrecognizedArgMessage(replSpecificOption))
35+
expect(res.out.lines().endsWith(unrecognizedArgMessage(replSpecificOption)))
3636
}
3737
}
3838

@@ -112,7 +112,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
112112
)
113113
.call(cwd = root, mergeErrIntoOut = true, check = false)
114114
expect(res.exitCode == 1)
115-
expect(res.out.trim() == unrecognizedArgMessage(replSpecificOption))
115+
expect(res.out.lines().endsWith(unrecognizedArgMessage(replSpecificOption)))
116116
}
117117
}
118118

@@ -165,7 +165,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
165165
"-classpath",
166166
(os.rel / compilationOutputDir).toString
167167
).call(cwd = root, mergeErrIntoOut = true)
168-
expect(runRes.out.trim() == replDryRunOutput)
168+
expect(runRes.out.lines().lastOption.contains(replDryRunOutput))
169169
}
170170
}
171171

@@ -189,7 +189,7 @@ class DefaultTests extends WithWarmUpScalaCliSuite {
189189
|
190190
|To list all available options, run
191191
| ${Console.BOLD}${TestUtil.detectCliPath} --help${Console.RESET}
192-
|""".stripMargin.trim
192+
|""".stripMargin.trim.linesIterator.toVector
193193

194194
private lazy val replDryRunOutput = "Dry run, not running REPL."
195195
}

0 commit comments

Comments
 (0)