hledger-lib-1.2: 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 Source #

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

flattenTests :: Test -> [Test] Source #

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

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

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

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

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

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

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

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

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 Source #

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

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