event-data-theory-0.30.3: event data theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

EventDataTheory.Test

Description

 
Synopsis

Documentation

eventDecodeTests :: forall m t a b. (Eventable t m a, EventLineAble t m a b, FromJSONEvent t m a) => FilePath -> TestTree Source #

Creates a group of tests from all the files in given directory for all files ending in '.jsonl'. Each file should contain 1 line containing 1 event. Each test passes if the decoding results in a Right a value.

The test group is meant as a smoke test to check that events you think should parse do in fact parse.

eventDecodeFailTests :: forall m t a b. (Eventable t m a, EventLineAble t m a b, FromJSONEvent t m a) => FilePath -> TestTree Source #

Creates a group of tests from all the files in given directory for all files ending in '.jsonl'. Each file should contain 1 line containing 1 event. Each test passes if the decoding results in a Left String value.

The test group is meant as a smoke test to check that events you think should _not_ parse do not in fact parse.

eventLineRoundTripTests :: forall m t a b. (Eventable t m a, FromJSONEvent t m a, ToJSONEvent t m a, SizedIv (Interval a)) => FilePath -> TestTree Source #

Creates a group of tests from all the files in given directory for all files ending in '.jsonl'. Each file should contain 1 line containing 1 event. Each test passes if the decoding results in a Right a value.

The test group is meant as a smoke test to check that events you think should parse do in fact parse.

eventLineModifyTests :: forall m t a b. (Eventable t m a, EventLineAble t m a b, FromJSONEvent t m a, Data m) => FilePath -> TestTree Source #

Creates a group of tests from all the files in given directory for all files ending in '.jsonl'. Each file should contain 1 line containing 1 event.

Tests pass if: * the file decodes into an EventLine * the result can be passed through modifyEventLineWithContext using the identity function without modifying the result.

NOTE: Tags need to be ordered within the JSON files. The underlying type of TagSet is Set, thus elements will be ordered by their Ord instance in the result.

eventOrdTests :: TestTree Source #

Tests of Ord instance for Event.