hledger-lib-1.3: Core data types, parsers and functionality for the hledger accounting tools

Safe Haskell | None
Language | Haskell2010

Hledger.Utils.Test

Synopsis

- testName :: Test -> String
- flattenTests :: Test -> [Test]
- filterTests :: (Test -> Bool) -> Test -> Test
- is :: (Eq a, Show a) => a -> a -> Assertion
- assertParse :: (Show t, Show e) => Either (ParseError t e) a -> Assertion
- assertParseFailure :: Either (ParseError t e) a -> Assertion
- assertParseEqual :: (Show a, Eq a, Show t, Show e) => Either (ParseError t e) a -> a -> Assertion
- printParseError :: Show a => a -> IO ()

# Documentation

testName :: Test -> String #

Get a Test's label, or the empty string.

flattenTests :: Test -> [Test] #

Flatten a Test containing TestLists into a list of single tests.

filterTests :: (Test -> Bool) -> Test -> Test #

Filter TestLists in a Test, recursively, preserving the structure.

is :: (Eq a, Show a) => a -> a -> Assertion #

Simple way to assert something is some expected value, with no label.

assertParse :: (Show t, Show e) => Either (ParseError t e) a -> Assertion #

Assert a parse result is successful, printing the parse error on failure.

assertParseFailure :: Either (ParseError t e) a -> Assertion #

Assert a parse result is successful, printing the parse error on failure.

assertParseEqual :: (Show a, Eq a, Show t, Show e) => Either (ParseError t e) a -> a -> Assertion #

Assert a parse result is some expected value, printing the parse error on failure.

printParseError :: Show a => a -> IO () #