tasty-kat-0.0.3: Known Answer Tests (KAT) framework for tasty
LicenseMIT
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell2010

Test.Tasty.KAT.FileLoader

Description

extra loaders helpers

Synopsis

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 #