首页 \ 问答 \ scalatest在intellij 13.1中不起作用(scalatest not working in intellij 13.1)

scalatest在intellij 13.1中不起作用(scalatest not working in intellij 13.1)

我似乎无法让Intellij 13.1运行我的测试。 我创建了一个简单的项目来尝试和隔离问题,但它也没有在那里工作。 这是我的设置:

  • Intellij 13.1针对JDK 1.6(正在使用的java库需要)
  • SBT支持scala 2.10项目
  • 最新的scalatest(libraryDependencies + =“org.scalatest”%“scalatest_2.11”%“2.2.1”%“test”)

这是sut:

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)
  }
}

这是我得到的错误:

错误:scalac:编译时:/Users/test-user/Development/temp/sample/src/test/scala/Calc$Test.scala在阶段:typer库版本:版本2.10.4编译器版本:版本2.10.4重建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/Jav aVirtualMachines / 1.6.0.jdk /内容/班/ classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6。 0.jdk /内容/班/ 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 /内容/首页/ lib / ext目录/ dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/系统/库/ Java的/ JavaVirtualMachines / 1.6.0.jdk /内容/首页/ lib / ext目录/程序(sunjce_provider.jar):/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/用户/测试用户/开发/温度/样品/目标/阶-2.10 /测试类:/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/ja RS /斯卡拉 - 反射 - 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。罐子:/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 typer的最后一棵树:Apply(method ==)symbol:method = =在类Int(flags :)符号定义:def ==(x:Int):Boolean tpe:布尔符号所有者:方法== - >类Int - >包scala上下文所有者:value - > class Calc $ Test - > package == Enclosing template or block == Template(// val:in class Calc $ Test“FunSuite”// parent ValDef(private“_”)// 2语句DefDef(// def():Calc $ Test in class Calc $ Test“”[] List(Nil)// tree.tpe = Calc $ Test Block(// tree.tpe = Unit Apply(// def():类FunSuite中的org.scalatest.FunSuite,tree.tpe = org.scalatest.FunSuite Calc $ Test.super。“”// def():类FunSuite中的org.scalatest.FunSuite,tree.tpe = ()org.scalatest.FunSuite Nil)()))Apply(Apply(“test”“两个数字应该添加”)Apply(“assert”Apply(// def ==(x:Int):Int类中的布尔值, tree.tpe = Boolean Calc.add(2,5)。“$ eq $ eq”// def ==(x:Int):类Int中的布尔值,tree.tpe =(x:Int)布尔值7))) )==扩展类型的树== TypeRef(TypeSymbol(最终抽象类布尔值扩展AnyVal))编译期间未捕获的异常:scala.MatchError

知道问题可能是什么吗? 我认为这是由一个简单的配置问题引起的,因为代码很简单。


I can't seem to get Intellij 13.1 to run my tests. I've created a simple project to try and isolate the problem but it is also not working there. Here is my setup:

  • Intellij 13.1 Targeting JDK 1.6 (needed for java libraries being used)
  • SBT backed scala 2.10 project
  • latest scalatest (libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.1" % "test")

Here is the sut:

object Calc {
  def add(a: Int, b: Int) = {
    a + b
  }
}

Here is the test:

import org.scalatest.FunSuite

class Calc$Test extends FunSuite {
  test("two number should add") {
    assert(Calc.add(2, 5) == 7)
  }
}

This is the error I am getting:

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

Any idea what the issue might be? I assume this is caused by a simple config problem as the code is about as simple as can be.


原文:https://stackoverflow.com/questions/25773740
更新时间:2022-06-18 20:06

最满意答案

UIFont限制为每个字体系列有两种变体。 但是,您可以通过在编辑器中打开其他n-2字体并更改系列名称来解决此问题。

在这里回答了我自己的问题: UIFont fontWithName:限于每个家庭加载2个变种


UIFont is limited to two variations per font family. However, you can work around this by opening the additional n-2 fonts in an editor and changing the family name.

Answered my own question about this here: UIFont fontWithName: limited to loading 2 variations per family

相关问答

更多
  • 好的,所以我现在就开始工作,积分去了 斜体字体不适用于XCode 我不得不查看完整的文件名。 解决方案是使用 UIFont fontWithName:@"BPreplay-Italic" ,我在有关文件本身的信息中找到了它。 Ok so I got it working now, credits go to Italic Font Is Not Working on XCode I had to look into the full file-name. The solution was to use UI ...
  • 我觉得你有一个错字。 它必须被称为B e basNeue,但你将其命名为B basNeue,而不是e 。 它必须与font-file中设置的名称完全相同。 I think you've got a typo. It has to be called BebasNeue but you named it BabasNeue, with an a instead of an e. It needs to be the exact same name as set in the font-file.
  • 尝试这个: NSMutableDictionary *titleBarAttributes = [NSMutableDictionary dictionaryWithDictionary: [[UINavigationBar appearance] titleTextAttributes]]; [titleBarAttributes setValue:[UIFont fontWithName:@"adellebasic_bold" size:25.0f] forKey:UITextAttr ...
  • 问题出现在片段中,我不知道为什么它会重复元素,所以我没有创建MainFragment类,我按照本教程改编了http://examples.javacodegeeks.com/core-java/android-facebook -login-示例/ 现在,我可以在同一个活动中使用自定义字体和facebook登录。 The problem was in the fragment, I don't know why it duplicates the elements, so I didn't create t ...
  • 在没有放弃UIDatePicker或[UILabel appearance] ,我没有找到解决此问题的“正确”解决方案,但我确实找到了至少隐藏问题的黑客攻击。 似乎在最初加载视图时,可以使用标签的外观代理绘制保存所选日期的文本的UILabel ,但是在重置日期UIDatePicker重新绘制UIDatePicker时,它会将标签设置回系统字体。 要隐藏问题,请在viewWillAppear:中将日期设置为具有不同日期组件的两个不同日期值,然后将选择器设置回正确的日期,如下所示: [datePicker se ...
  • 字体的postscript名称是AlegreSans 更新这一行 [lblObj setFont:[UIFont fontWithName:@"Alegre Sans" size:10.0]]: 至 [lblObj setFont:[UIFont fontWithName:@"AlegreSans" size:10.0]]; The font's postscript name is AlegreSans Update this line [lblObj setFont:[UIFont fontWith ...
  • 您需要设置活动对象的下拉值。 你可以从selection:created获得selection:created和selection:updated事件。 /* When working with custom fonts on a fabric canvas, it is recommended to use a font preloader. Not doing so is likely to cause texts that are imported onto the canvas to b ...
  • UIFont限制为每个字体系列有两种变体。 但是,您可以通过在编辑器中打开其他n-2字体并更改系列名称来解决此问题。 在这里回答了我自己的问题: UIFont fontWithName:限于每个家庭加载2个变种 UIFont is limited to two variations per font family. However, you can work around this by opening the additional n-2 fonts in an editor and changing t ...
  • 更新:其他人传给我一个类似的(如果不是相同的)字体集,这些字体工作正常。 所以我认为我最初使用的字体必定已损坏。 奇怪的是,该字体仍然在Font Book中成功显示,当我将其与其他程序(如Open Office)一起使用时。 故事的道德:如果自定义字体的一组代码正常工作且特定字体不起作用,则故障可能与该特定字体有关。 Update: Someone else passed me a similar (if not the same) set of fonts and those fonts worked f ...
  • 您必须将它添加到应用程序的info.plist中的UIAppFonts键,然后您可以在代码中使用它,您不能直接将它添加到Interface Builder。 我发现这篇文章非常有用我可以在iPhone应用程序中嵌入自定义字体吗? You have to add it to the UIAppFonts key in your app's info.plist, and then you can use it in code, you can't add it to Interface Builder dir ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)