diff --git a/plutus-benchmark/common/PlutusBenchmark/Common.hs b/plutus-benchmark/common/PlutusBenchmark/Common.hs index b03aade8c09..78591158eee 100644 --- a/plutus-benchmark/common/PlutusBenchmark/Common.hs +++ b/plutus-benchmark/common/PlutusBenchmark/Common.hs @@ -1,5 +1,5 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE LambdaCase #-} {- | Miscellaneous shared code for benchmarking-related things. -} module PlutusBenchmark.Common @@ -245,16 +245,17 @@ checkGoldenFileExists path = do fullPath <- makeAbsolute path fileExists <- doesFileExist path if not fileExists - then errorWithExplanation $ "golden file " ++ fullPath ++ " does not exist." - else do - perms <- getPermissions path - if not (writable perms) - then errorWithExplanation $ "golden file " ++ fullPath ++ " is not writable." - else pure () - where errorWithExplanation s = - let msg = "\n* ERROR: " ++ s ++ "\n" - ++ "* To ensure that the correct path is used, either use `cabal test` " - ++ "or run the test in the root directory of the relevant package.\n" - ++ "* If this is the first time this test has been run, create an " - ++ "initial golden file manually." - in error msg + then errorWithExplanation $ "golden file " ++ fullPath ++ " does not exist." + else do + perms <- getPermissions path + if not (writable perms) + then errorWithExplanation $ "golden file " ++ fullPath ++ " is not writable." + else pure () + where + errorWithExplanation s = + let msg = "\n* ERROR: " ++ s ++ "\n" + ++ "* To ensure that the correct path is used, either use `cabal test` " + ++ "or run the test in the root directory of the relevant package.\n" + ++ "* If this is the first time this test has been run, create an " + ++ "initial golden file manually." + in error msg diff --git a/plutus-benchmark/common/PlutusBenchmark/NaturalSort.hs b/plutus-benchmark/common/PlutusBenchmark/NaturalSort.hs index e3bd13a0f23..ad170baa737 100644 --- a/plutus-benchmark/common/PlutusBenchmark/NaturalSort.hs +++ b/plutus-benchmark/common/PlutusBenchmark/NaturalSort.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE LambdaCase #-} module PlutusBenchmark.NaturalSort (naturalSort) where diff --git a/plutus-benchmark/plutus-benchmark.cabal b/plutus-benchmark/plutus-benchmark.cabal index 7ada0bbb9e5..f0e6e2d8ed5 100644 --- a/plutus-benchmark/plutus-benchmark.cabal +++ b/plutus-benchmark/plutus-benchmark.cabal @@ -78,6 +78,7 @@ common lang ---------------- Common code for benchmarking ---------------- library plutus-benchmark-common + visibility: public import: lang, os-support hs-source-dirs: common exposed-modules: