2015-06-21 31 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