Created
November 26, 2019 13:22
-
-
Save lazyval/346f5f45484119aaf6d3bddb6e33d1d0 to your computer and use it in GitHub Desktop.
Scalacheck example for trivial scalatest violation
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
package com.spotify | |
import org.scalatest.prop.GeneratorDrivenPropertyChecks | |
import org.scalatest.{FlatSpec, Matchers} | |
class ExampleTest extends FlatSpec with Matchers with GeneratorDrivenPropertyChecks { | |
implicit override val generatorDrivenConfig = | |
PropertyCheckConfig(minSize = 100, maxSize = 200) | |
"strings" should "have same length when lowercased / uppercased" in { | |
forAll { x: String => | |
val uppercased = x.toUpperCase() | |
val lowercased = x.toLowerCase() | |
uppercased.length should equal(lowercased.length) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment