| Copyright | (c) 2024 |
|---|---|
| License | BSD3 |
| Maintainer | maintainer@example.com |
| Safe Haskell | None |
| Language | GHC2021 |
Test.Hindsight.Examples
Contents
Description
Example event definitions used in test suites and store backend tests.
Includes utilities like DeterministicText for reproducible testing.
Synopsis
- type UserCreated = "user_created"
- data UserInformation0 = UserInformation0 {}
- data UserInformation1 = UserInformation1 {}
- data UserInformation2 = UserInformation2 {}
- newtype DeterministicText = DeterministicText Text
- tree :: TestTree
Documentation
type UserCreated = "user_created" Source #
data UserInformation0 Source #
Version 0 of user information
Constructors
| UserInformation0 | |
Instances
data UserInformation1 Source #
Version 1 of user information with optional email
Instances
| Arbitrary UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples | |||||
| FromJSON UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples Methods parseJSON :: Value -> Parser UserInformation1 # parseJSONList :: Value -> Parser [UserInformation1] # | |||||
| ToJSON UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples Methods toJSON :: UserInformation1 -> Value # toEncoding :: UserInformation1 -> Encoding # toJSONList :: [UserInformation1] -> Value # toEncodingList :: [UserInformation1] -> Encoding # omitField :: UserInformation1 -> Bool # | |||||
| Generic UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples Associated Types
Methods from :: UserInformation1 -> Rep UserInformation1 x # to :: Rep UserInformation1 x -> UserInformation1 # | |||||
| Show UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples Methods showsPrec :: Int -> UserInformation1 -> ShowS # show :: UserInformation1 -> String # showList :: [UserInformation1] -> ShowS # | |||||
| Eq UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples Methods (==) :: UserInformation1 -> UserInformation1 -> Bool # (/=) :: UserInformation1 -> UserInformation1 -> Bool # | |||||
| type Rep UserInformation1 Source # | |||||
Defined in Test.Hindsight.Examples type Rep UserInformation1 = D1 ('MetaData "UserInformation1" "Test.Hindsight.Examples" "hindsight-core-0.1.0.0-inplace-event-testing" 'False) (C1 ('MetaCons "UserInformation1" 'PrefixI 'True) (S1 ('MetaSel ('Just "userId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "userEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) | |||||
data UserInformation2 Source #
Constructors
| UserInformation2 | |
Instances
| Arbitrary UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples | |||||
| FromJSON UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples Methods parseJSON :: Value -> Parser UserInformation2 # parseJSONList :: Value -> Parser [UserInformation2] # | |||||
| ToJSON UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples Methods toJSON :: UserInformation2 -> Value # toEncoding :: UserInformation2 -> Encoding # toJSONList :: [UserInformation2] -> Value # toEncodingList :: [UserInformation2] -> Encoding # omitField :: UserInformation2 -> Bool # | |||||
| Generic UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples Associated Types
Methods from :: UserInformation2 -> Rep UserInformation2 x # to :: Rep UserInformation2 x -> UserInformation2 # | |||||
| Show UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples Methods showsPrec :: Int -> UserInformation2 -> ShowS # show :: UserInformation2 -> String # showList :: [UserInformation2] -> ShowS # | |||||
| Eq UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples Methods (==) :: UserInformation2 -> UserInformation2 -> Bool # (/=) :: UserInformation2 -> UserInformation2 -> Bool # | |||||
| type Rep UserInformation2 Source # | |||||
Defined in Test.Hindsight.Examples type Rep UserInformation2 = D1 ('MetaData "UserInformation2" "Test.Hindsight.Examples" "hindsight-core-0.1.0.0-inplace-event-testing" 'False) (C1 ('MetaCons "UserInformation2" 'PrefixI 'True) ((S1 ('MetaSel ('Just "userId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "userEmail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "likeability") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))) | |||||
newtype DeterministicText Source #
Newtype wrapper for deterministic Text generation in property tests.
TODO: Move this to a dedicated testing utilities module (e.g., Test.Hindsight.Util.Arbitrary) once the test-lib structure is finalized. This is a general-purpose testing utility that shouldn't be tied to the Examples module.
Constructors
| DeterministicText Text |
Instances
| Arbitrary DeterministicText Source # | |
Defined in Test.Hindsight.Examples | |
| Show DeterministicText Source # | |
Defined in Test.Hindsight.Examples Methods showsPrec :: Int -> DeterministicText -> ShowS # show :: DeterministicText -> String # showList :: [DeterministicText] -> ShowS # | |
| Eq DeterministicText Source # | |
Defined in Test.Hindsight.Examples Methods (==) :: DeterministicText -> DeterministicText -> Bool # (/=) :: DeterministicText -> DeterministicText -> Bool # | |
Orphan instances
| Event UserCreated Source # | |
| MigrateVersion 0 UserCreated Source # | |
Methods migrateVersion :: PayloadAtVersion (ToPeanoNat 0) (EventVersionVector UserCreated) -> CurrentPayloadType UserCreated # | |
| MigrateVersion 1 UserCreated Source # | |
Methods migrateVersion :: PayloadAtVersion (ToPeanoNat 1) (EventVersionVector UserCreated) -> CurrentPayloadType UserCreated # | |
| MigrateVersion 2 UserCreated Source # | |
Methods migrateVersion :: PayloadAtVersion (ToPeanoNat 2) (EventVersionVector UserCreated) -> CurrentPayloadType UserCreated # | |
| Upcast 0 UserCreated Source # | |
Methods upcast :: PayloadAtVersion (ToPeanoNat 0) (EventVersionVector UserCreated) -> PayloadAtVersion (ToPeanoNat (0 + 1)) (EventVersionVector UserCreated) # | |
| Upcast 1 UserCreated Source # | |
Methods upcast :: PayloadAtVersion (ToPeanoNat 1) (EventVersionVector UserCreated) -> PayloadAtVersion (ToPeanoNat (1 + 1)) (EventVersionVector UserCreated) # | |