Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An Elm program using elm-check that is compatible with elm-test (the Node module)
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
myClaims : Claim
myClaims =
"List Reverse"
[ Check.claim
"Reversing a list twice yields the original list"
`that` (\list -> List.reverse (List.reverse list))
`is` identity
`for` Producer.list
, 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
evidence : Evidence
evidence =
Check.quickCheck myClaims
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment