Skip to content

Commit b599359

Browse files
committed
Revert "tests: Bring tool args reading to REPL tests"
This reverts commit 89f0e7f.
1 parent 6565219 commit b599359

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// scalac: -source:future -deprecation
22
scala> type M[X] = X match { case Int => String case _ => Int }
3-
1 warning found
4-
-- Deprecation Warning: --------------------------------------------------------
3+
-- Deprecation Warning:
54
1 | type M[X] = X match { case Int => String case _ => Int }
65
| ^
76
| `_` is deprecated for wildcard arguments of types: use `?` instead
87
scala> type N[X] = X match { case List[_] => Int }
9-
1 warning found
10-
-- Deprecation Warning: --------------------------------------------------------
8+
-- Deprecation Warning:
119
1 | type N[X] = X match { case List[_] => Int }
1210
| ^
1311
| `_` is deprecated for wildcard arguments of types: use `?` instead

compiler/test/dotty/tools/repl/ReplTest.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,19 @@ extends ReplDriver(options, new PrintStream(out, true, StandardCharsets.UTF_8.na
6464

6565
val expectedOutput = lines.flatMap(filterEmpties)
6666
val actualOutput = {
67-
val opts = toolArgsParse(lines.take(1))
68-
val (optsLine, inputLines) = if opts.isEmpty then ("", lines) else (lines.head, lines.drop(1))
69-
resetToInitial(opts)
67+
resetToInitial()
7068

71-
assert(inputLines.head.startsWith(prompt),
69+
assert(lines.head.startsWith(prompt),
7270
s"""Each script must start with the prompt: "$prompt"""")
73-
val inputRes = inputLines.filter(_.startsWith(prompt))
71+
val inputRes = lines.filter(_.startsWith(prompt))
7472

7573
val buf = new ArrayBuffer[String]
7674
inputRes.foldLeft(initialState) { (state, input) =>
7775
val (out, nstate) = evaluate(state, input)
7876
out.linesIterator.foreach(buf.append)
7977
nstate
8078
}
81-
(optsLine :: buf.toList).flatMap(filterEmpties)
79+
buf.toList.flatMap(filterEmpties)
8280
}
8381

8482
if !FileDiff.matches(actualOutput, expectedOutput) then

0 commit comments

Comments
 (0)