Skip to content

Commit

Permalink
Switch to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejG604 committed Oct 11, 2023
1 parent 8405ed4 commit 61c0d2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 7 additions & 0 deletions modules/cli/src/test/scala/cli/tests/OptionsCheck.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scala.cli.tests

import scala.cli.ScalaCliCommands
import scala.cli.commands.shared.HasGlobalOptions

class OptionsCheck extends munit.FunSuite {

Expand All @@ -12,4 +13,10 @@ class OptionsCheck extends munit.FunSuite {
command.ensureNoDuplicates()
}

test(s"--power option present in $command") {
command.parser.stopAtFirstUnrecognized.parse(Seq("--power")) match {
case Right((_: HasGlobalOptions, _ +: _)) => fail("Expected --power to be recognized")
case _ => ()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,4 @@ class SipScalaTests extends ScalaCliSuite {
)
}
}

test("--power flag anywhere") {
for (command <- Seq("run", "test", "compile", "repl", "package", "export"))
assert(
os.proc(TestUtil.cli, command, "--power", "--help")
.call()
.exitCode == 0,
s"Expected --power flag to work after $command command"
)
}
}

0 comments on commit 61c0d2d

Please sign in to comment.