/
RunOptionsTests.scala
39 lines (32 loc) · 1.11 KB
/
RunOptionsTests.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package scala.cli.commands.tests
import com.eed3si9n.expecty.Expecty.{assert => expect}
import scala.cli.commands.run.{Run, RunOptions, SharedRunOptions}
import scala.cli.commands.shared.{SharedOptions, SharedPythonOptions}
class RunOptionsTests extends munit.FunSuite {
test("ScalaPy version") {
val ver = "X.Y.Z"
val runOptions = RunOptions(
shared = SharedOptions(
sharedPython = SharedPythonOptions(
scalaPyVersion = Some(ver)
)
)
)
val buildOptions = Run.buildOptions(runOptions).value
expect(buildOptions.notForBloopOptions.scalaPyVersion.contains(ver))
}
test("resolve toolkit dependency") {
val runOptions = RunOptions(
shared = SharedOptions(
toolkit = Some("latest")
)
)
val buildOptions = Run.buildOptions(runOptions).value
val dep = buildOptions.classPathOptions.extraDependencies.toSeq.headOption
assert(dep.nonEmpty)
val toolkitDep = dep.get.value
expect(toolkitDep.organization == "org.virtuslab")
expect(toolkitDep.name == "toolkit")
expect(toolkitDep.version == "latest.release")
}
}