Skip to content

Instantly share code, notes, and snippets.

@sergio-sastre
Created July 18, 2021 10:08
Show Gist options
  • Save sergio-sastre/890090a48d72830019e5d95ed3f62c67 to your computer and use it in GitHub Desktop.
Save sergio-sastre/890090a48d72830019e5d95ed3f62c67 to your computer and use it in GitHub Desktop.
Multiplying the quality of your Unit Tests (Part2) with PBT - When PBT is not enough alone
fun String?.reversed() : String? = this //forgot to reverse it?
@Label("Reversing a reversed String returns the original")
@Property
fun reverseStringTest(@ForAll originalString: String?) {
assertTrue(
originalString?.reversed()?.reversed() == originalString
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment