Test that the given text is the same as what we find in the given golden file.
Modulesydtest-0.22.0.0Haskell2010
Test.Syd.Def.Golden
- 1 type
- 13 values
- Packagesydtest-0.22.0.0
- Exports14
- LanguageHaskell2010
- LicenceLicenseRef-OtherLicense
- SourceGolden.hs
Test that the produced text is the same as what we find in the given golden file.
Test that the given bytestring is the same as what we find in the given golden file.
Test that the produced bytestring is the same as what we find in the given golden file.
Test that the given lazy bytestring is the same as what we find in the given golden file.
Note: This converts the lazy bytestring to a strict bytestring first.
Test that the produced bytestring is the same as what we find in the given golden file.
Note: This converts the lazy bytestring to a strict bytestring first.
Test that the given lazy bytestring is the same as what we find in the given golden file.
Note: This converts the builder to a strict bytestring first.
Test that the produced bytestring is the same as what we find in the given golden file.
Note: This converts the builder to a strict bytestring first.
Test that the given string is the same as what we find in the given golden file.
Test that the produced string is the same as what we find in the given golden file.
Test that the show instance has not changed for the given value.
Test that the show instance has not changed for the given value, via ppShow.
The golden test context for adding context to a golden test assertion:
goldenTestCompare = \actual expected ->
if actual == expected
then Nothing
else Just $ Context (stringsNotEqualButShouldHaveBeenEqual actual expected) (goldenContext fp)A golden test for output of type a.
The purpose of a golden test is to ensure that the output of a certain process does not change even over time.
Golden tests can also be used to show how the output of a certain process changes over time and force code reviewers to review the diff that they see in the PR.
This works by saving a golden output in the repository somewhere,
committing it, and then compare that golden output to the output that is
currently being produced. You can use `--golden-reset` to have sydtest
update the golden output by writing the current output.
Constructors
GoldenTestgoldenTestRead :: IO (Maybe a)Read the golden test output, Nothing if there is no golden output yet.
goldenTestProduce :: IO aProduce the current output
goldenTestWrite :: a -> IO ()Write golden output
goldenTestCompare :: a -> a -> IO (Maybe Assertion)Compare golden output with current output
The first argument is the current output, the second is the golden output
Instances18IsTest, Arg1, Arg2, …
IsTest (IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.RunIsTest (GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.RunIsTest (arg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.RunIsTest (arg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.RunIsTest (outerArgs -> innerArg -> IO (GoldenTest a))Defined in sydtest-0.22.0.0 · Test.Syd.RunIsTest (outerArgs -> innerArg -> GoldenTest a)Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (arg -> IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (arg -> GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (outerArgs -> innerArg -> IO (GoldenTest a)) = outerArgsDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg1 (outerArgs -> innerArg -> GoldenTest a) = outerArgsDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (IO (GoldenTest a)) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (GoldenTest a) = ()Defined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (arg -> IO (GoldenTest a)) = argDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (arg -> GoldenTest a) = argDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (outerArgs -> innerArg -> IO (GoldenTest a)) = innerArgDefined in sydtest-0.22.0.0 · Test.Syd.Runtype Arg2 (outerArgs -> innerArg -> GoldenTest a) = innerArgDefined in sydtest-0.22.0.0 · Test.Syd.Run