3

scalacheck出力から実行する場合sbt console、列幅は 76 文字に制限されます。

$ 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.

その制限を増やす方法はありますか?

4

2 に答える 2

2

残念ながら、ScalaCheck ( https://github.com/rickynils/scalacheck/blob/master/src/main/scala/org/scalacheck/util/ConsoleReporter.scala )でハードコーディングされているため、これを変更することはできません。 . ScalaCheck の Github ページで問題を開くことをお勧めします。

于 2015-06-30T20:09:54.810 に答える
1

で幅の値がハードコードされているため、これは不可能ですConsoleReportermainただし、 で定義されたを使用してテストを実行している場合Propertiesは、次の操作を実行できます。

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

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

  ...

}

そして、独自のコードで、にWideConsoleReporter基づいて作成しConsoleReporterます。

于 2018-01-10T17:07:58.057 に答える