Created
July 30, 2011 08:49
-
-
Save alios/1115344 to your computer and use it in GitHub Desktop.
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
{-# 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