Created
December 23, 2018 16:08
-
-
Save erip/0076be380ffb143f569d2f6764f4c20a to your computer and use it in GitHub Desktop.
A simple property test
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
use "ponytest" | |
use "ponycheck" | |
class iso AdditionAssociativeProperty is UnitTest | |
fun name(): String => "u8/addition-associative" | |
fun apply(h: TestHelper)? => | |
let g = recover val Generators.zip3[U8, U8, U8]( | |
Generators.u8(), Generators.u8(), Generators.u8() | |
) end | |
Ponycheck.for_all[(U8, U8, U8)](g, h)( | |
{(args, ph) => | |
(var arg0, var arg1, var arg2) = args | |
ph.assert_eq[U8]( | |
(arg0 + arg1) + arg2, | |
arg0 + (arg1 + arg2) | |
) | |
})? | |
actor Main is TestList | |
new create(env: Env) => | |
PonyTest(env, this) | |
fun tag tests(test: PonyTest) => | |
test(AdditionAssociativeProperty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment