Skip to content

Instantly share code, notes, and snippets.

@alios
Created July 30, 2011 08:49
Show Gist options
  • Save alios/1115344 to your computer and use it in GitHub Desktop.
Save alios/1115344 to your computer and use it in GitHub Desktop.
{-# LANGUAGE TemplateHaskell #-}
import Test.QuickCheck.All
t1 x = x * x
t2 x = (x-1)*(x+1)+1
t3 x = (x-2)*(x+2)+4
prop_x1 x = t1 x == t2 x
prop_x2 x = t2 x == t3 x
prop_x3 x = t1 x == t3 x
runTests = $quickCheckAll
{-
*Main> runTests
=== prop_x1 on /home/alios/tmp/foo.hs:10 ===
+++ OK, passed 100 tests.
=== prop_x2 on /home/alios/tmp/foo.hs:11 ===
+++ OK, passed 100 tests.
=== prop_x3 on /home/alios/tmp/foo.hs:12 ===
+++ OK, passed 100 tests.
True
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment