Expressing a property in ScalaCheck that does not have evaluations discarded
<p>Given this:</p>

<pre><code>  property("Empty range") {
    forAll { (min: Int, max: Int) =&gt;
      whenever (min == max) {
        Range(min, max).size should be (0)
      }
    }
  }
</code></pre>

<p>I get </p>

<pre><code>[info] - Empty range *** FAILED *** 
[info]   Gave up after 5 successful property evaluations. 96 evaluations were discarded.
</code></pre>

<p>How do I express my test case, which is to capture the property of a Range that regardless of <code>a</code> and <code>b</code>, if they are equal then <code>Range(a,b)</code> should be empty.</p>

<p>Another one:</p>

<pre><code>  property("10 long range") {
    forAll { (min: Int, max: Int) =&gt;
      whenever (min &lt; max &amp;&amp; (max.toLong-min.toLong).abs == 10) {
        Range(min, max).head should be (min)
      }
    }
  }
</code></pre>

<p>I have a bunch of test cases like this (for a class similar to <code>Range</code>), all of them failing with the same error.</p>

<p>I would like to capture Ranges with a given size, and testing elements within that range - the idea being that I want ScalaCheck to generate the Range boundaries for me.</p>