aboutsummaryrefslogtreecommitdiff
path: root/tests/Properties.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Properties.hs')
-rw-r--r--tests/Properties.hs24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index b42cd4b..e50c7e8 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -1,15 +1,25 @@
1{-# LANGUAGE TemplateHaskell #-} 1{-# LANGUAGE TemplateHaskell #-}
2module Properties where 2module Properties where
3 3
4import Parser (Expr (..), 4import Parser (Expr (..), parseLispValue, parseQuote)
5 parseLispValue,
6 parseQuote)
7 5
8import Test.Framework.Providers.QuickCheck2
9import Test.Framework.TH
10import Test.QuickCheck 6import Test.QuickCheck
11import Text.ParserCombinators.Parsec
12 7
13-- some tests would go here hopefully 8-- some tests would go here hopefully
14 9
15tests = $testGroupGenerator 10-- a filler test to test the test suite :^)
11qsort :: (Ord a) => [a] -> [a]
12qsort [] = []
13qsort [x] = [x]
14qsort (x:xs) = qsort left ++ [x] ++ qsort right
15 where left = filter (<= x) xs
16 right = filter (> x) xs
17
18checkList :: (Ord a) => [a] -> Bool
19checkList = ordered . qsort
20 where ordered [] = True
21 ordered [x] = True
22 ordered (x:y:xs) = x <= y && ordered (y:xs)
23
24return []
25tests = $quickCheckAll