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
最满意答案
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
相关问答
更多-
自定义字体未显示(Custom font not showing up)[2023-02-09]
好的,所以我现在就开始工作,积分去了 斜体字体不适用于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 ...
-
Android:当我使用自定义字体时,TextView会重复(Android: TextView is duplicated when I use a custom font)[2022-04-09]
问题出现在片段中,我不知道为什么它会重复元素,所以我没有创建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 ... -
为UILabel外观设置自定义字体会导致UIDatePicker错误(Setting custom font for UILabel appearance causes UIDatePicker bug)[2024-01-24]
在没有放弃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 ...
-
自定义字体不起作用(Custom Font Does Not Work)[2022-09-15]
更新:其他人传给我一个类似的(如果不是相同的)字体集,这些字体工作正常。 所以我认为我最初使用的字体必定已损坏。 奇怪的是,该字体仍然在Font Book中成功显示,当我将其与其他程序(如Open Office)一起使用时。 故事的道德:如果自定义字体的一组代码正常工作且特定字体不起作用,则故障可能与该特定字体有关。 Update: Someone else passed me a similar (if not the same) set of fonts and those fonts worked f ... -
uilabel自定义字体?(uilabel custom font?)[2021-09-14]
您必须将它添加到应用程序的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 ...