- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我似乎无法让 Intellij 13.1 运行我的测试。我创建了一个简单的项目来尝试隔离问题,但它也无法在那里工作。这是我的设置:
object Calc {
def add(a: Int, b: Int) = {
a + b
}
}
import org.scalatest.FunSuite
class Calc$Test extends FunSuite {
test("two number should add") {
assert(Calc.add(2, 5) == 7)
}
}
Error:scalac: while compiling: /Users/test-user/Development/temp/sample/src/test/scala/Calc$Test.scala during phase: typer library version: version 2.10.4 compiler version: version 2.10.4 reconstructed args: -nobootcp -javabootclasspath : -classpath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/Users/test-user/Development/temp/sample/target/scala-2.10/test-classes:/Users/test-user/Development/temp/sample/target/scala-2.10/classes:/Users/test-user/.sbt/boot/scala-2.10.4/lib/scala-library.jar:/Users/test-user/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar:/Users/test-user/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.2.jar:/Users/test-user/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.2.jar:/Users/test-user/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-2.2.1.jar:/Users/test-user/.sbt/boot/scala-2.10.4/lib/scala-reflect.jar:/Users/test-user/.sbt/boot/scala-2.10.4/lib/scala-compiler.jar last tree to typer: Apply(method ==) symbol: method == in class Int (flags: ) symbol definition: def ==(x: Int): Boolean tpe: Boolean symbol owners: method == -> class Int -> package scala context owners: value -> class Calc$Test -> package == Enclosing template or block == Template( // val : in class Calc$Test "FunSuite" // parents ValDef( private "_" ) // 2 statements DefDef( // def (): Calc$Test in class Calc$Test "" [] List(Nil) // tree.tpe=Calc$Test Block( // tree.tpe=Unit Apply( // def (): org.scalatest.FunSuite in class FunSuite, tree.tpe=org.scalatest.FunSuite Calc$Test.super."" // def (): org.scalatest.FunSuite in class FunSuite, tree.tpe=()org.scalatest.FunSuite Nil ) () ) ) Apply( Apply( "test" "two number should add" ) Apply( "assert" Apply( // def ==(x: Int): Boolean in class Int, tree.tpe=Boolean Calc.add(2, 5)."$eq$eq" // def ==(x: Int): Boolean in class Int, tree.tpe=(x: Int)Boolean 7 ) ) ) ) == Expanded type of tree == TypeRef(TypeSymbol(final abstract class Boolean extends AnyVal)) uncaught exception during compilation: scala.MatchError
最佳答案
您显然遇到的一个问题是,您要求使用为 Scala 2.11 编译的 scalatest 版本,但您说您使用的是 Scala 2.10。您需要在 build.sbt 中使用“scalatest_2.10”而不是“scalatest_2.11”。用
libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.2.1" % "test"
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.1" % "test"
关于Scalatest 在 Intellij 13.1 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25773740/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!