diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 1e84ef6..56bc017 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 63e86e9..33c9cce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ------------- @@ -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 ----------- diff --git a/Test/Tasty/Golden/Internal.hs b/Test/Tasty/Golden/Internal.hs index e540872..b3447ed 100644 --- a/Test/Tasty/Golden/Internal.hs +++ b/Test/Tasty/Golden/Internal.hs @@ -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 diff --git a/tasty-golden.cabal b/tasty-golden.cabal index e4c31a5..20c8c19 100644 --- a/tasty-golden.cabal +++ b/tasty-golden.cabal @@ -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». @@ -21,8 +21,12 @@ maintainer: Roman Cheplyaka -- 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 @@ -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 diff --git a/tests/golden/before-accept.golden b/tests/golden/before-accept.golden index 44f3d2a..78b7156 100644 --- a/tests/golden/before-accept.golden +++ b/tests/golden/before-accept.golden @@ -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 @@ -35,6 +36,7 @@ Tests 169d156 < 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 @@ -87,8 +89,9 @@ Tests 55 56 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 @@ -116,5 +119,6 @@ Tests 169d156 < 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