Created
April 17, 2016 00:04
-
-
Save jessitron/a558f0f5dc76a6818a38dedf0a3bbb59 to your computer and use it in GitHub Desktop.
An Elm program using elm-check that is compatible with elm-test (the Node module)
This file contains hidden or 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
module Main (..) where | |
import ElmTest | |
import Check exposing (Evidence, Claim, that, is, for) | |
import Check.Test | |
import Check.Producer as Producer | |
import List | |
import Signal exposing (Signal) | |
import Console exposing (IO) | |
import Task | |
console : IO () | |
console = | |
ElmTest.consoleRunner (Check.Test.evidenceToTest evidence) | |
port runner : Signal (Task.Task x ()) | |
port runner = | |
Console.run console | |
myClaims : Claim | |
myClaims = | |
Check.suite | |
"List Reverse" | |
[ Check.claim | |
"Reversing a list twice yields the original list" | |
`that` (\list -> List.reverse (List.reverse list)) | |
`is` identity | |
`for` Producer.list Producer.int | |
, Check.claim | |
"Reversing a list does not modify its length" | |
`that` (\list -> List.length (List.reverse list)) | |
`is` (\list -> List.length list) | |
`for` Producer.list Producer.int | |
] | |
evidence : Evidence | |
evidence = | |
Check.quickCheck myClaims |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment