File: example-explicit.hs

package info (click to toggle)
haskell-tasty-th 0.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 80 kB
  • sloc: haskell: 152; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 588 bytes parent folder | download
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 Main where

import Test.Tasty
import Test.Tasty.TH
import Test.Tasty.QuickCheck
import Test.Tasty.HUnit

main :: IO ()
main = $(defaultMainGeneratorFor "explicit" ["prop_length_append", "case_length_1", "test_plus"])

prop_length_append :: [Int] -> [Int] -> Bool
prop_length_append as bs = length (as ++ bs) == length as + length bs

case_length_1 :: Assertion
case_length_1 = 1 @=? length [()]

case_add :: Assertion
case_add = 7 @=? (3 + 4)

test_plus :: [TestTree]
test_plus =
  [ $(testGroupGeneratorFor "case_add" ["case_add"])
    -- ...
  ]