Skip to content

Instantly share code, notes, and snippets.

@zenlambda
Last active December 28, 2015 15:19
Show Gist options
  • Save zenlambda/7520515 to your computer and use it in GitHub Desktop.
Save zenlambda/7520515 to your computer and use it in GitHub Desktop.

Revisions

  1. zenlambda revised this gist Nov 18, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion error.txt
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@
    [info] arg1 = ""
    [info] )

    // failing "scalatest doc property" i not mentioned anywhere in this error!
    // failing "scalatest doc property" is not mentioned anywhere in this error!
  2. zenlambda created this gist Nov 18, 2013.
    15 changes: 15 additions & 0 deletions ScalaCheckProperties.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    package simulations

    import org.scalacheck.Properties
    import org.scalacheck.Prop.forAll

    class ScalaCheckProperties extends Properties("Properties from ScalaTest Docs") {

    // based on example "supply argument names" property from:
    // http://www.scalatest.org/user_guide/generator_driven_property_checks

    property("scalatest doc property") = forAll { (a: String, b: String) =>
    a.length + b.length == ((a + b).length + 1) // Should fail
    }

    }
    15 changes: 15 additions & 0 deletions ScalaTestSuite.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    package simulations

    import org.scalatest.FunSuite
    import org.scalatest.prop.Checkers
    import org.junit.runner.RunWith
    import org.scalatest.junit.JUnitRunner

    @RunWith(classOf[JUnitRunner])
    class ScalaTestSuite extends FunSuite with Checkers {

    test("scalatest property test") {
    check(new ScalaCheckProperties)
    }

    }
    12 changes: 12 additions & 0 deletions error.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [info] ScalaTestSuite:
    [info] - scalatest property test *** FAILED ***
    [info] GeneratorDrivenPropertyCheckFailedException was thrown during property evaluation.
    [info] (ScalaTestSuite.scala:12)
    [info] Falsified after 0 successful property evaluations.
    [info] Location: (ScalaTestSuite.scala:12)
    [info] Occurred when passed generated values (
    [info] arg0 = "",
    [info] arg1 = ""
    [info] )

    // failing "scalatest doc property" i not mentioned anywhere in this error!