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