tasty-kat-0.0.3: Known Answer Tests (KAT) framework for tasty

License | MIT
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | Good
Safe Haskell | None
Language | Haskell2010

Test.Tasty.KAT.FileLoader

Contents

- generic helpers on TestResource
- common helpers on TestResource
- common value decoding helpers
- associated hierarchy of KAT types

Description

extra loaders helpers

Synopsis

- katLoader :: Char -> String -> [String] -> TestResource (String, String)
- katLoaderSimple :: [String] -> TestResource (String, String)
- mapTestUnitValues :: (String -> a) -> TestResource (String, String) -> TestResource (String, a)
- mapTestUnits :: (TestUnit (String, a) -> TestUnit b) -> TestResource (String, a) -> TestResource b
- mapTestUnitValuesBase64 :: TestResource (String, String) -> TestResource (String, ByteString)
- mapTestUnitValuesBase16 :: TestResource (String, String) -> TestResource (String, ByteString)
- valueUnbase16 :: String -> ByteString
- valueUnbase64 :: String -> ByteString
- valueInteger :: String -> Integer
- valueHexInteger :: String -> Integer
- type TestResource a = [(String, TestGroup a)]
- type TestGroup a = [TestUnit a]
- type TestUnit a = [a]

# Documentation

katLoader Source #

Arguments

:: Char | key value separator, e.g. '='
-> String | line comment, e.g. "--" "#"
-> [String] | input lines
-> TestResource (String, String) |

katLoaderSimple :: [String] -> TestResource (String, String) Source #

From a simple KAT file, extract

- lines starting by #, are assumed to be comment

format should be the following:

    skipped ..
    skipped ..
    [group1]

    f1= v1
    f2= v2
    ...

    f1= v3
    f2= v4
    ...

    [group2]
    ...

# generic helpers on TestResource

mapTestUnitValues :: (String -> a) -> TestResource (String, String) -> TestResource (String, a) Source #

mapTestUnits :: (TestUnit (String, a) -> TestUnit b) -> TestResource (String, a) -> TestResource b Source #

# common helpers on TestResource

mapTestUnitValuesBase64 :: TestResource (String, String) -> TestResource (String, ByteString) Source #

mapTestUnitValuesBase16 :: TestResource (String, String) -> TestResource (String, ByteString) Source #

# common value decoding helpers

valueUnbase16 :: String -> ByteString Source #

valueUnbase64 :: String -> ByteString Source #

valueInteger :: String -> Integer Source #

valueHexInteger :: String -> Integer Source #

# associated hierarchy of KAT types

type TestResource a = [(String, TestGroup a)] Source #

type TestGroup a = [TestUnit a] Source #

type TestUnit a = [a] Source #