From 498b0510a64d4acdd4b36cb3ee077c62f709aa64 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Thu, 26 Sep 2024 12:42:31 +0200 Subject: [PATCH] Merge the redundant `ReplTests` into `ReplTestDefinitions` --- .../cli/integration/ReplTestDefinitions.scala | 33 +++++++++++++++++ .../scala/cli/integration/ReplTests.scala | 36 ------------------- 2 files changed, 33 insertions(+), 36 deletions(-) delete mode 100644 modules/integration/src/test/scala/scala/cli/integration/ReplTests.scala diff --git a/modules/integration/src/test/scala/scala/cli/integration/ReplTestDefinitions.scala b/modules/integration/src/test/scala/scala/cli/integration/ReplTestDefinitions.scala index d7a1caac1e..8a435ac724 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/ReplTestDefinitions.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/ReplTestDefinitions.scala @@ -53,4 +53,37 @@ abstract class ReplTestDefinitions extends ScalaCliSuite with TestScalaVersionAr expect(scalaVersionHelp.contains(s"(${Constants.defaultScala} by default)")) } } + + test("calling repl with -Xshow-phases flag") { + val cmd = Seq[os.Shellable]( + TestUtil.cli, + "repl", + "-Xshow-phases", + extraOptions + ) + + val res = os.proc(cmd).call(mergeErrIntoOut = true) + expect(res.exitCode == 0) + val output = res.out.text() + expect(output.contains("parser")) + expect(output.contains("typer")) + } + + test("calling repl with a directory with no scala artifacts") { + val inputs = TestInputs( + os.rel / "Testing.java" -> "public class Testing {}" + ) + val cmd = Seq[os.Shellable]( + TestUtil.cli, + "repl", + "--repl-dry-run", + ".", + extraOptions + ) + inputs.fromRoot { root => + val res = os.proc(cmd) + .call(cwd = root) + expect(res.exitCode == 0) + } + } } diff --git a/modules/integration/src/test/scala/scala/cli/integration/ReplTests.scala b/modules/integration/src/test/scala/scala/cli/integration/ReplTests.scala deleted file mode 100644 index cf06174639..0000000000 --- a/modules/integration/src/test/scala/scala/cli/integration/ReplTests.scala +++ /dev/null @@ -1,36 +0,0 @@ -package scala.cli.integration - -import com.eed3si9n.expecty.Expecty.expect - -class ReplTests extends ScalaCliSuite { - test("calling repl with -Xshow-phases flag") { - val cmd = Seq[os.Shellable]( - TestUtil.cli, - "repl", - "-Xshow-phases" - ) - - val res = os.proc(cmd).call(mergeErrIntoOut = true) - expect(res.exitCode == 0) - val output = res.out.text() - expect(output.contains("parser") && output.contains("typer")) - } - - test("calling repl with a directory with no scala artifacts") { - val inputs = TestInputs( - os.rel / "Testing.java" -> "public class Testing {}" - ) - val cmd = Seq[os.Shellable]( - TestUtil.cli, - "repl", - "--repl-dry-run", - "." - ) - inputs.fromRoot { root => - val res = os.proc(cmd) - .call(cwd = root) - expect(res.exitCode == 0) - } - } - -}