From 8b08ea946d1fc73d8363efb633b8063f750520bf Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 13 Oct 2020 23:09:42 +0530 Subject: rework test suite --- tests/Properties.hs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'tests/Properties.hs') 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 @@ {-# LANGUAGE TemplateHaskell #-} module Properties where -import Parser (Expr (..), - parseLispValue, - parseQuote) +import Parser (Expr (..), parseLispValue, parseQuote) -import Test.Framework.Providers.QuickCheck2 -import Test.Framework.TH import Test.QuickCheck -import Text.ParserCombinators.Parsec -- some tests would go here hopefully -tests = $testGroupGenerator +-- 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 -- cgit v1.2.3