Skip to content

Instantly share code, notes, and snippets.

@jessitron
Created April 17, 2016 00:04
Show Gist options
  • Save jessitron/a558f0f5dc76a6818a38dedf0a3bbb59 to your computer and use it in GitHub Desktop.
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)
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