From a17eefc8a0f086d1e9d0cbded3d61db2f62dd68b Mon Sep 17 00:00:00 2001 From: Steven Dee Date: Sun, 20 Oct 2013 20:41:51 -0400 Subject: [PATCH] Official, fancy tests --- hsnock.cabal | 5 +++++ Test.hs => test.hs | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) rename Test.hs => test.hs (85%) diff --git a/hsnock.cabal b/hsnock.cabal index c905502..37f7945 100644 --- a/hsnock.cabal +++ b/hsnock.cabal @@ -7,6 +7,11 @@ category: Language build-type: Simple cabal-version: >=1.8 +test-suite test + type: exitcode-stdio-1.0 + main-is: test.hs + build-depends: base >=4.5, parsec >=3.1, QuickCheck >=2.6 + executable hsnock main-is: nock.hs build-depends: base >=4.5, parsec >=3.1, readline >=1.0 diff --git a/Test.hs b/test.hs similarity index 85% rename from Test.hs rename to test.hs index 8168633..adf956b 100644 --- a/Test.hs +++ b/test.hs @@ -10,10 +10,10 @@ main = mapM_ (\(s,a) -> printf "%-25s: " s >> a) tests instance Arbitrary Noun where arbitrary = do coin <- arbitrary if coin - then liftM (Atom . abs) arbitrary - else do a <- arbitrary - b <- arbitrary - return $ a :- b + then liftM (Atom . abs) arbitrary + else do a <- arbitrary + b <- arbitrary + return $ a :- b prop_parse_show n = n == ps n where ps n = case parse noun "" (show n) of