aboutsummaryrefslogtreecommitdiff
path: root/tests/Properties.hs
blob: e50c7e8e40878de660699fbe2cb50784c8b60bc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE TemplateHaskell #-}
module Properties where

import           Parser          (Expr (..), parseLispValue, parseQuote)

import           Test.QuickCheck

-- some tests would go here hopefully

-- a filler test to test the test suite :^)
qsort :: (Ord a) => [a] -> [a]
qsort [] = []
qsort [x] = [x]
qsort (x:xs) = qsort left ++ [x] ++ qsort right
    where left = filter (<= x) xs
          right = filter (> x) xs

checkList :: (Ord a) => [a] -> Bool
checkList = ordered . qsort
    where ordered []       = True
          ordered [x]      = True
          ordered (x:y:xs) = x <= y && ordered (y:xs)

return []
tests = $quickCheckAll