From 8b08ea946d1fc73d8363efb633b8063f750520bf Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 13 Oct 2020 23:09:42 +0530 Subject: rework test suite --- lisk.cabal | 12 ++++-------- tests/Main.hs | 4 +--- tests/Properties.hs | 24 +++++++++++++++++------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lisk.cabal b/lisk.cabal index 9578a85..4687e9c 100644 --- a/lisk.cabal +++ b/lisk.cabal @@ -19,7 +19,7 @@ extra-source-files: CHANGELOG.md library default-language: Haskell2010 build-depends: - base >=4.12 && <4.13, + base == 4.*, parsec == 3.*, mtl >= 2.1 hs-source-dirs: src @@ -34,7 +34,7 @@ executable lisk default-language: Haskell2010 main-is: Main.hs build-depends: - base >=4.12 && <4.13, + base == 4.*, parsec == 3.*, readline >= 1.0, mtl >= 2.1, @@ -47,12 +47,8 @@ test-suite properties main-is: Main.hs hs-source-dirs: tests build-depends: - base >=4.12 && <4.13, + base == 4.*, parsec == 3.*, - QuickCheck >= 2.4 && < 3, - test-framework >= 0.6 && < 0.9, - test-framework-hunit >= 0.3 && < 0.5, - test-framework-quickcheck2 >= 0.2 && < 0.4, - test-framework-th >= 0.2 && < 0.4, + QuickCheck >= 2.1 && < 3, lisk other-modules: Properties 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 @@ module Main where import Properties -import Test.Framework.Providers.QuickCheck2 -import Test.Framework.Runners.Console (defaultMain) import Test.QuickCheck -main = defaultMain [ Properties.tests ] +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 @@ {-# 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