How to use ScalaCheck's collect and classify in ScalaTest?

45 views
Skip to first unread message

Aravind Reddy

unread,
Sep 7, 2016, 3:27:28 AM9/7/16
to scalacheck

The following use of Prop.collect((a, b)) isn't printing the statistics as expected even though the test runs successfully.

import org.scalacheck.Prop
import org.scalatest.{GivenWhenThen, PropSpec}
import org.scalatest.prop.{Checkers, GeneratorDrivenPropertyChecks}

import org.scalacheck.Prop.AnyOperators

class AccountSpecWithMarkup extends PropSpec with Checkers with GeneratorDrivenPropertyChecks {

  property("max") {
    check({
      (a:Int, b:Int) => {

        Prop.collect((a, b)) {

          a != b || a == b
        }
      }
    })
  }
}

Reply all
Reply to author
Forward
0 new messages