Skip to content

Commit

Permalink
Use let binding for goldenFile in each test
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed May 30, 2024
1 parent 17fc7ea commit fdb7796
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test-suite-golden/src/Golden.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,47 +55,52 @@ goldenTestSet title dhallFiles = do
[ testGroup ".dhall to .cabal"
[ goldenVsFile
(testName dhallFile)
(cabalFile -<.> goldExt Cabal)
goldenFile
cabalFile
(writeDhallCabal dhallFile)
| dhallFile <- dhallFiles
, let cabalFile = cabalFilePath dhallFile
, let goldenFile = cabalFile -<.> goldExt Cabal
]
, testGroup ".dhall to dhall"
[ goldenVsString
(testName dhallFile)
(dhallFile -<.> goldExt Dhall)
goldenFile
(fmap fromString . showDhall $ dhallFile)
| dhallFile <- dhallFiles
, let goldenFile = dhallFile -<.> goldExt Dhall
]
, testGroup ".dhall to json"
[ goldenVsFile
(testName dhallFile)
(dhallFile -<.> goldExt Json)
goldenFile
jsonFile
(writeJson dhallFile jsonFile)
| dhallFile <- dhallFiles
, let jsonFile = dhallFile -<.> ".json"
, let goldenFile = dhallFile -<.> goldExt Json
]
, testGroup ".dhall to yaml"
[ goldenVsFile
(testName dhallFile)
(dhallFile -<.> goldExt Yaml)
goldenFile
yamlFile
(writeYaml dhallFile yamlFile)
| dhallFile <- dhallFiles
, let yamlFile = dhallFile -<.> ".yaml"
, let goldenFile = dhallFile -<.> goldExt Yaml
]
, testGroup ".yaml to .cabal"
[ goldenVsFile
(testName dhallFile)
(cabalFile -<.> goldExt Cabal)
goldenFile
cabalFile
(writeYamlCabal yamlFile cabalFile yamlCabalFile)
| dhallFile <- dhallFiles
, let yamlFile = dhallFile -<.> ".yaml"
, let cabalFile = cabalFilePath dhallFile
, let yamlCabalFile = yamlFile <.> ".cabal"
, let goldenFile = cabalFile -<.> goldExt Cabal
]
]

Expand Down

0 comments on commit fdb7796

Please sign in to comment.