下面是测试用例的片段
src/test/scala
:
package example.module
import utest._
object ModuleSpec extends TestSuite { ... }
... 这段代码编译得很好
build.sbt
如下:
val testDependencies: Seq[ModuleID] =
Seq(
"com.lihaoyi" %% "utest" % "0.6.5" % "test",
)
def testSettings: Seq[Setting[_]] =
Seq(
libraryDependencies ++= testDependencies)
lazy val root =
(project in file("."))
.aggregate(subproject)
lazy val subproject =
(project in file("subproject"))
.settings(testSettings: _*)
我的问题是:
如果我添加
Test
轴心
libraryDependencies
,如下图所示?
def testSettings: Seq[Setting[_]] =
Seq(
libraryDependencies in Test ++= testDependencies)
更详细地说:
包含
import utest._
未能编译,这意味着现在声明为
libraryDependencies in Test
被忽视了。
论证:
因为我要在
src/main/test
,我希望如此
测试中的库依赖性
将是本案中必要且充分的信息。换句话说,我不认为需要更大的范围。