Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
- name: Create stack.yaml
run: |
echo "resolver: ${{ matrix.plan.resolver }}" > stack.yaml
# echo "flags: { tasty-golden: { build-example: true }}" >> stack.yaml
# Andreas Abel, 2025-12-15
# The golden values created by the example are not portable,
# so running the example test on CI fails.

- name: Build dependencies
run: stack test --system-ghc --only-dependencies
Expand Down
21 changes: 13 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
Changes
=======

Unreleased
----------
Version 2.3.6
-------------

* Option `--no-create-file` now available internally as `NoCreateFile`
([Issue #50](https://github.com/UnkindPartition/tasty-golden/issues/50))
* Drop support for GHC 7, remove obsolete `deriving Typeable`
* Tested with GHC 8.0 - 9.14.0

* Drop support for GHC 7, remove obsoleted `deriving Typeable`
_Andreas Abel, 2025-12-15_

Version 2.3.5
-------------

* Fixes for launching external processes (like diff) on Windows
* Update the golden file on --accept if decoding the golden file failed with an exception
* Do not depend on unix-compat
* Fixes for launching external processes (like `diff`) on Windows
* Update the golden file on `--accept` if decoding the golden file failed with an exception
* Do not depend on `unix-compat`

Version 2.3.4
-------------
Expand Down Expand Up @@ -76,12 +81,12 @@ contract.
Version 2.3.0.2
---------------

Switch from temporary-rc to temporary
Switch from `temporary-rc` to `temporary`

Version 2.3.0.1
---------------

Impose a lower bound version constraint on bytestring.
Impose a lower bound version constraint on `bytestring`.

Version 2.3
-----------
Expand Down
2 changes: 2 additions & 0 deletions Test/Tasty/Golden/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ instance IsOption AcceptTests where

-- | This option, when set to 'True', specifies to error when a file does
-- not exist, instead of creating a new file.
--
-- @since 2.3.6
newtype NoCreateFile = NoCreateFile Bool
deriving (Eq, Ord)
instance IsOption NoCreateFile where
Expand Down
11 changes: 8 additions & 3 deletions tasty-golden.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.14
cabal-version: 2.0
name: tasty-golden
version: 2.3.5
version: 2.3.6
synopsis: Golden tests support for tasty
description:
This package provides support for «golden testing».
Expand All @@ -21,8 +21,12 @@ maintainer: Roman Cheplyaka <[email protected]>
-- copyright:
category: Testing
build-type: Simple
extra-source-files:

extra-doc-files:
CHANGELOG.md
README.md

extra-source-files:
example/golden/fail/*.golden
example/golden/success/*.golden
tests/golden/*.golden
Expand Down Expand Up @@ -93,6 +97,7 @@ Test-suite test
, temporary
if (flag(build-example))
cpp-options: -DBUILD_EXAMPLE
build-tool-depends: tasty-golden:example
Ghc-options: -threaded

flag build-example
Expand Down
6 changes: 5 additions & 1 deletion tests/golden/before-accept.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Tests
Failing tests
goldenVsFile: FAIL
Files 'example/golden/fail/goldenVsFile.golden' and 'example/golden/fail/goldenVsFile.actual' differ
Use -p '$0=="Tests.Failing tests.goldenVsFile"' to rerun this test only.
goldenVsFileDiff: FAIL
1d0
< 1
Expand Down Expand Up @@ -35,6 +36,7 @@ Tests
169d156
<<truncated>
Use --accept or increase --size-cutoff to see full output.
Use -p '/Failing tests.goldenVsFileDiff/' to rerun this test only.
goldenVsString: FAIL
Test output was different from 'example/golden/fail/goldenVsString.golden'. It was:
2
Expand Down Expand Up @@ -87,8 +89,9 @@ Tests
55
56<truncated>
Use --accept or increase --size-cutoff to see full output.
Use -p '$0=="Tests.Failing tests.goldenVsString"' to rerun this test only.
goldenVsStringDiff: FAIL
Test output was different from 'example/golden/fail/goldenVsStringDiff.golden'. Output of ["diff","example/golden/fail/goldenVsStringDiff.golden","/tmp/goldenVsStringDiff.actual"]:
Test output was different from 'example/golden/fail/goldenVsStringDiff.golden'. Output of ["diff","example/golden/fail/goldenVsStringDiff.golden","/private/var/folders/19/d9jtc4c5365g3c_5jjk7m_980000gn/T/goldenVsStringDiff.actual"]:
1d0
< 1
4d2
Expand Down Expand Up @@ -116,5 +119,6 @@ Tests
169d156
<<truncated>
Use --accept or increase --size-cutoff to see full output.
Use -p '/Failing tests.goldenVsStringDiff/' to rerun this test only.

4 out of 8 tests failed
Loading