Muki-SkyWalker / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

Specs/ScalaCheck Integration Problems Under 2.8 #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Consider the following snippet:

    val prop = forAll { i: Int =>
      i mustEqual 0
    }

    prop must pass

Aside from being utterly ridiculous, this spec doesn't work properly under
Scala 2.8 (using snapshot versions of both Specs and ScalaCheck).  The
problem seems to be that Matcher results are always implicitly converted to
`false`, rather than `true` (as one would expect for a passing match). 
This spec will *always* fail, even when `i` randomly gets a value of 0. 
The spec works fine under Scala 2.7 with Specs 1.6.2 and ScalaCheck 1.6. 
The slight modification below works correctly under 2.8 and 2.7 (but of
course, without the nice Specs matcher power):

    val prop = forAll { i: Int =>
      i == 0
    }

    prop must pass

(again, ignoring the ludicrous nature of the property)  :-)

Original issue reported on code.google.com by djspie...@gmail.com on 4 Apr 2010 at 5:46

GoogleCodeExporter commented 9 years ago
I've reproduced the issue, it must be a case of implicit priority working 
differently.

If you force the implicit def that should be used the Prop seem to work:

val prop = forAll { i: Int => successValueToBoolean(i must_== 0) }
prop must pass

will fail with the expected failure message, while:

val prop = forAll { i: Int => successValueToBoolean(i must_== i) }
prop must pass

will pass.

I'll try to find out what's wrong there and how I can fix it.

I'll try to 

Original comment by etorrebo...@gmail.com on 4 Apr 2010 at 11:10

GoogleCodeExporter commented 9 years ago
Hi Daniel,

This issue is fixed here: http://scala-tools.org/repo-snapshots/org/scala-
tools/testing/specs_2.8.0.Beta1/1.6.5-SNAPSHOT

Eric.

Original comment by etorrebo...@gmail.com on 5 Apr 2010 at 9:33

GoogleCodeExporter commented 9 years ago

Original comment by etorrebo...@gmail.com on 26 May 2010 at 10:24

GoogleCodeExporter commented 9 years ago

Original comment by etorrebo...@gmail.com on 1 Aug 2010 at 7:52