diff options
| author | manuel <manuel@mausz.at> | 2012-05-21 03:32:40 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-05-21 03:32:40 +0200 |
| commit | a61ebc600a4fc7445787100d0c54fb633e7ee5c9 (patch) | |
| tree | e33aea7465416280c985d67647c03ac59e520d20 | |
| parent | ef2756b480d56b5b29f34235e13c2028d125b973 (diff) | |
| download | ffp-a61ebc600a4fc7445787100d0c54fb633e7ee5c9.tar.gz ffp-a61ebc600a4fc7445787100d0c54fb633e7ee5c9.tar.bz2 ffp-a61ebc600a4fc7445787100d0c54fb633e7ee5c9.zip | |
add tests for exercise 7
note: quickCheck gets called but there's no output parsing
| -rw-r--r-- | TestAufgabeFFP7.hs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/TestAufgabeFFP7.hs b/TestAufgabeFFP7.hs index 1262c23..116a445 100644 --- a/TestAufgabeFFP7.hs +++ b/TestAufgabeFFP7.hs | |||
| @@ -3,16 +3,36 @@ module Main where | |||
| 3 | import Test.HUnit | 3 | import Test.HUnit |
| 4 | import Control.Monad | 4 | import Control.Monad |
| 5 | import AufgabeFFP7 | 5 | import AufgabeFFP7 |
| 6 | import Test.QuickCheck | ||
| 7 | import System.IO.Unsafe | ||
| 6 | 8 | ||
| 9 | {-- | ||
| 7 | cases1 = TestLabel "TODO" $ TestList [ | 10 | cases1 = TestLabel "TODO" $ TestList [ |
| 8 | TestCase $ assertEqual "TODO" (result) (call) | 11 | TestCase $ assertEqual "TODO" (result) (call) |
| 9 | ... | 12 | ... |
| 10 | ] | 13 | ] |
| 14 | --} | ||
| 15 | |||
| 16 | -------------------------------------------------------------------------------- | ||
| 17 | |||
| 18 | cases2 = TestLabel "ssfn/minfree" $ TestList [ | ||
| 19 | TestCase $ assertEqual "ssfn1" (5) (ssfn [0,1,2,3,4,6,7,8,9]), | ||
| 20 | TestCase $ assertEqual "minfree1" (5) (minfree [0,1,2,3,4,6,7,8,9]), | ||
| 21 | TestCase $ assertEqual "ssfn2" (0) (ssfn [1,2,3,4,5,6,7,8,9]), | ||
| 22 | TestCase $ assertEqual "minfree2" (0) (minfree [1,2,3,4,5,6,7,8,9]), | ||
| 23 | TestCase $ assertEqual "ssfn/minfree" | ||
| 24 | (ssfn (filter (/=499) [0..520])) | ||
| 25 | (minfree (filter (/=499) [0..520])), | ||
| 26 | TestCase $ assertEqual "quickCheck1" () | ||
| 27 | (unsafePerformIO (quickCheck prop_ssfn_eq_minfree_a)), | ||
| 28 | TestCase $ assertEqual "quickCheck2" () | ||
| 29 | (unsafePerformIO (quickCheck prop_ssfn_eq_minfree_b)) | ||
| 30 | ] | ||
| 11 | 31 | ||
| 12 | -------------------------------------------------------------------------------- | 32 | -------------------------------------------------------------------------------- |
| 13 | 33 | ||
| 14 | tests :: [Test] | 34 | tests :: [Test] |
| 15 | tests = [cases1, ...] | 35 | tests = [cases2] |
| 16 | 36 | ||
| 17 | main = do | 37 | main = do |
| 18 | forM tests $ \test -> | 38 | forM tests $ \test -> |
