【发布时间】:2018-10-06 16:01:10
【问题描述】:
我有一套 scalatest 测试,它们在运行时使用 println 将信息输出到控制台。
当我使用 Eclipse Scala 插件(使用上下文菜单中的Run As ... / 3 ScalaTest - File)运行该套件时,控制台会输出关于哪些测试通过和哪些失败的附加输出。我猜这个输出来自跑步者。
问题是我的代码中的行和运行器中的行没有明智地交错。就好像它们是从两个不同步的不同线程中打印出来的。
例如这里是运行的输出
>>>>>>>>>>>>>Starting The parser should warn when the interface name at the end does not match >>>>>>>>>>>>>>>>>>
(interface Fred
interface Bob)
-----------------------------
File: <unknown> line: 2 column: 11 Name does not match.
----The AST after parsing-------------
[ IntfDeclNd( (), (), () ) ]
---------------------------------------
<<<<<<<<<<<<<Finished The parser should warn when the interface name at the end does not match <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>Starting The parser should parse a class with generic args >>>>>>>>>>>>>>>>>>
(class Fred{type a, type b extends B}() class)
- should parse multiline comment at end of file *** FAILED ***
Expected 0, but got 1 (TestsBase.scala:103)
- should fail on incomplete multiline comment
- should parse single line comments
- should allow a class name to be repeated at the end
- should warn when the class name at the end does not match
- should allow an interface name to be repeated at the end
- should warn when the interface name at the end does not match
----The AST after parsing-------------
以“- should”或“Expected”开头的行来自跑步者,您可以看到其中一堆被插入我的一个测试的输出中间。跑步者的其他输出出现在其他地方,这还不是全部。
我的问题:为什么会这样?有没有办法让跑步者的输出与我的输出相协调?
【问题讨论】:
标签: scalatest