| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Skeletest.Internal.Snapshot
Synopsis
- matchesSnapshot :: forall a (m :: Type -> Type). (Typeable a, MonadIO m) => Predicate m a
- data SnapshotRenderer = Typeable a => SnapshotRenderer {
- render :: a -> Text
- snapshotLang :: Maybe Text
- setSnapshotRenderers :: [SnapshotRenderer] -> IO ()
- getSnapshotRenderers :: MonadIO m => m [SnapshotRenderer]
- plainRenderer :: Typeable a => (a -> Text) -> SnapshotRenderer
- renderWithShow :: (Typeable a, Show a) => SnapshotRenderer
- data SnapshotFile = SnapshotFile {}
- data SnapshotTestId
- mkSnapshotTestId :: [Text] -> SnapshotTestId
- data SnapshotValue = SnapshotValue {}
- decodeSnapshotFile :: Text -> Maybe SnapshotFile
- encodeSnapshotFile :: (SnapshotTestId -> Int) -> SnapshotFile -> Text
- normalizeSnapshotFile :: SnapshotFile -> SnapshotFile
- snapshotPlugin :: Plugin
Predicate
matchesSnapshot :: forall a (m :: Type -> Type). (Typeable a, MonadIO m) => Predicate m a Source #
A predicate checking if the input matches the snapshot. See the "Snapshot tests" section in the README.
>>>user `shouldSatisfy` P.matchesSnapshot
Rendering
data SnapshotRenderer Source #
Constructors
| Typeable a => SnapshotRenderer | |
Fields
| |
setSnapshotRenderers :: [SnapshotRenderer] -> IO () Source #
getSnapshotRenderers :: MonadIO m => m [SnapshotRenderer] Source #
plainRenderer :: Typeable a => (a -> Text) -> SnapshotRenderer Source #
renderWithShow :: (Typeable a, Show a) => SnapshotRenderer Source #
SnapshotFile
data SnapshotFile Source #
Constructors
| SnapshotFile | |
Fields
| |
Instances
| Show SnapshotFile Source # | |
Defined in Skeletest.Internal.Snapshot Methods showsPrec :: Int -> SnapshotFile -> ShowS # show :: SnapshotFile -> String # showList :: [SnapshotFile] -> ShowS # | |
| Eq SnapshotFile Source # | |
Defined in Skeletest.Internal.Snapshot | |
data SnapshotTestId Source #
Instances
| Show SnapshotTestId Source # | |
Defined in Skeletest.Internal.Snapshot Methods showsPrec :: Int -> SnapshotTestId -> ShowS # show :: SnapshotTestId -> String # showList :: [SnapshotTestId] -> ShowS # | |
| Eq SnapshotTestId Source # | |
Defined in Skeletest.Internal.Snapshot Methods (==) :: SnapshotTestId -> SnapshotTestId -> Bool # (/=) :: SnapshotTestId -> SnapshotTestId -> Bool # | |
| Ord SnapshotTestId Source # | |
Defined in Skeletest.Internal.Snapshot Methods compare :: SnapshotTestId -> SnapshotTestId -> Ordering # (<) :: SnapshotTestId -> SnapshotTestId -> Bool # (<=) :: SnapshotTestId -> SnapshotTestId -> Bool # (>) :: SnapshotTestId -> SnapshotTestId -> Bool # (>=) :: SnapshotTestId -> SnapshotTestId -> Bool # max :: SnapshotTestId -> SnapshotTestId -> SnapshotTestId # min :: SnapshotTestId -> SnapshotTestId -> SnapshotTestId # | |
mkSnapshotTestId :: [Text] -> SnapshotTestId Source #
data SnapshotValue Source #
Instances
| Show SnapshotValue Source # | |
Defined in Skeletest.Internal.Snapshot Methods showsPrec :: Int -> SnapshotValue -> ShowS # show :: SnapshotValue -> String # showList :: [SnapshotValue] -> ShowS # | |
| Eq SnapshotValue Source # | |
Defined in Skeletest.Internal.Snapshot Methods (==) :: SnapshotValue -> SnapshotValue -> Bool # (/=) :: SnapshotValue -> SnapshotValue -> Bool # | |
| Ord SnapshotValue Source # | |
Defined in Skeletest.Internal.Snapshot Methods compare :: SnapshotValue -> SnapshotValue -> Ordering # (<) :: SnapshotValue -> SnapshotValue -> Bool # (<=) :: SnapshotValue -> SnapshotValue -> Bool # (>) :: SnapshotValue -> SnapshotValue -> Bool # (>=) :: SnapshotValue -> SnapshotValue -> Bool # max :: SnapshotValue -> SnapshotValue -> SnapshotValue # min :: SnapshotValue -> SnapshotValue -> SnapshotValue # | |
encodeSnapshotFile :: (SnapshotTestId -> Int) -> SnapshotFile -> Text Source #