File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
test/cardano-cli-golden/Test/Golden Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -519,6 +519,7 @@ test-suite cardano-cli-golden
519519 Test.Golden.Shelley.Transaction.Id
520520 Test.Golden.Shelley.Transaction.Sign
521521 Test.Golden.TxView
522+ Test.Golden.Util
522523 Test.Golden.Version
523524
524525 ghc-options :
Original file line number Diff line number Diff line change 1+ module Test.Golden.Util where
2+
3+ import Data.Text qualified as Text
4+ import GHC.Exts qualified as GHC
5+ import GHC.Stack (HasCallStack )
6+ import GHC.Stack qualified as GHC
7+ import System.FilePath (joinPath )
8+
9+ import Hedgehog.Extras (UnitIO )
10+ import Hedgehog.Extras qualified as H
11+
12+ noteGoldenFile
13+ :: HasCallStack
14+ => FilePath
15+ -> UnitIO FilePath
16+ noteGoldenFile fileName =
17+ GHC. withFrozenCallStack $ do
18+ case GHC. toList GHC. callStack of
19+ top : _ -> do
20+ let dirs = Text. unpack $ Text. intercalate " /" $ Text. splitOn " ." $ Text. pack $ GHC. srcLocModule (snd top)
21+
22+ H. note $ joinPath [" test/cardano-cli-golden/files/golden" , dirs, fileName]
23+ _ -> H. failMessage GHC. callStack $ " No call stack available for golden file: " <> fileName
You can’t perform that action at this time.
0 commit comments