gpt4 book ai didi

scala - 使 sbt 常量具有包含在测试和集成测试中的依赖项

转载 作者:行者123 更新时间:2023-12-03 20:22:36 24 4
gpt4 key购买 nike

如何声明库应该用于 TestIntegrationTest不会回到像 "test,it" 这样的字符串?

例子:

  "org.scalamock" %% "scalamock-scalatest-support" % "3.3.0" % Test,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test,it" //<- how to make this safer

最佳答案

我发现使用 Seq 和 mkstring 进行编码的最安全方法是:

"dependency" % Seq(Test, IntegrationTest).mkString(",")

这是一种解决方法,我不确定在构建中使用这种逻辑是否是一个好习惯。

关于scala - 使 sbt 常量具有包含在测试和集成测试中的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39785745/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com