Created
October 16, 2012 09:20
-
-
Save mads-hartmann/3898260 to your computer and use it in GitHub Desktop.
ScalaCheck Output That I don't understand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The output. | |
info] ! Multiset.remove: Falsified after 1 passed tests. | |
[info] > ARG_0: (ListMultiset(, ),) <<<---- this is what looks weird, but I guess it's a ListMultiset with "" (no space)," " (a space) and the string is "" (no space) | |
[info] ! Multiset.remove: Falsified after 7 passed tests. | |
[info] > ARG_0: (ListMultiset(),) | |
// The specification | |
property("remove") = forAll(genMultisetWithString) { ((ms: Multiset[String], s: String) => | |
(ms - s).size == ms.size - 1 | |
).tupled } | |
property("remove") = forAll(genMultisetWithString) { ((ms: Multiset[String], s: String) => | |
(ms - s).multiplicity(s) == ms.multiplicity(s) - 1 | |
).tupled } | |
// The generator | |
val genMultisetWithString = for { | |
mset <- genStringMultiset | |
s <- Arbitrary.arbitrary[String] | |
} yield (mset + s, s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code seems to work in the REPL though :-/