File: Main.hs

package info (click to toggle)
haskell-tasty-th 0.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 80 kB
  • sloc: haskell: 152; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 908 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 #-}
import Test.Tasty.TH
import Test.Tasty.HUnit
import Data.List (sort)

main :: IO ()
main = $(defaultMainGenerator)

case_example_test_functions :: Assertion
case_example_test_functions = do
  functions <- extractTestFunctions "example.hs"
  let expected = [ "prop_length_append", "case_length_1", "test_plus" ]
  sort expected @=? sort functions

case_example_explicit_test_functions :: Assertion
case_example_explicit_test_functions = do
  functions <- extractTestFunctions "example-explicit.hs"
  let expected = [ "case_add", "prop_length_append", "case_length_1", "test_plus" ]
  sort expected @=? sort functions

case_example_literate_test_functions :: Assertion
case_example_literate_test_functions = do
  functions <- extractTestFunctions "example-literate.lhs"
  let expected = [ "prop_length_append", "case_length_1", "test_plus" ]
  sort expected @=? sort functions