2015-06-21 85 views
2

当运行从sbt consolescalacheck的输出由76 char列宽度的限制:如何增加scalacheck控制台输出的字符列宽度?

$ sbt test:console 

import scalaz._ 
import Scalaz._ 
import scalacheck.ScalazProperties._ 
import scalacheck.ScalazArbitrary._ 
import scalacheck.ScalaCheckBinding._ 

scala> monad.laws[List].check 
+ monad.applicative.apply.functor.invariantFunctor.identity: OK, passed 100 
    tests. 
+ monad.applicative.apply.functor.invariantFunctor.composite: OK, passed 10 
    0 tests. 
+ monad.applicative.apply.functor.identity: OK, passed 100 tests. 
+ monad.applicative.apply.functor.composite: OK, passed 100 tests. 
+ monad.applicative.apply.composition: OK, passed 100 tests. 
+ monad.applicative.identity: OK, passed 100 tests. 
+ monad.applicative.homomorphism: OK, passed 100 tests. 
+ monad.applicative.interchange: OK, passed 100 tests. 
+ monad.applicative.map consistent with ap: OK, passed 100 tests. 
+ monad.bind.apply.functor.invariantFunctor.identity: OK, passed 100 tests. 
+ monad.bind.apply.functor.invariantFunctor.composite: OK, passed 100 tests 
    . 
+ monad.bind.apply.functor.identity: OK, passed 100 tests. 
+ monad.bind.apply.functor.composite: OK, passed 100 tests. 
+ monad.bind.apply.composition: OK, passed 100 tests. 
+ monad.bind.associativity: OK, passed 100 tests. 
+ monad.bind.ap consistent with bind: OK, passed 100 tests. 
+ monad.right identity: OK, passed 100 tests. 
+ monad.left identity: OK, passed 100 tests. 

是否有任何方式,以增加限制?

回答

0

这是不可能的,因为宽度值在ConsoleReporter中被硬编码。但是,如果你是在Properties定义的main运行测试,你可以做到以下几点:

object MyCheck extends Properties("My property check") { 

    override def overrideParameters(p: Test.Parameters) = 
     p.withTestCallback(WideConsoleReporter) 

    ... 

} 

然后在自己的代码,创建一个基于ConsoleReporterWideConsoleReporter