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

41 views
Skip to first unread message

Aravind Reddy

unread,
Sep 6, 2016, 7:27:37 PM9/6/16
to scalatest-users

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
        }
      }
    })
  }
}

Aravind Reddy

unread,
Sep 17, 2016, 9:46:15 AM9/17/16
to scalatest-users
Any suggestions or help here pls?

Bill Venners

unread,
Sep 17, 2016, 12:03:30 PM9/17/16
to scalate...@googlegroups.com
HI Aravind,

It is likely we don't print it. Can you elaborate on why you want that printed each time the test is run? 

Thanks.

Bill

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalatest-users@googlegroups.com
To unsubscribe from this group, send email to
scalatest-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bill Venners
Artima, Inc.
http://www.artima.com

Aravind Reddy

unread,
Sep 17, 2016, 1:08:02 PM9/17/16
to scalate...@googlegroups.com

It should be part of the report so that we can see the distribution of data generated. It is very useful for testers.


You received this message because you are subscribed to a topic in the Google Groups "scalatest-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalatest-users/loNpW1uBiD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalatest-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages