Skip to content

Commit bd74287

Browse files
committed
Merge branch 'accessor-tests' into no-flatten-package-description
2 parents f371b42 + 340c4c7 commit bd74287

File tree

414 files changed

+23458
-23397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+23458
-23397
lines changed

Cabal-tests/tests/ParserTests.hs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -288,29 +288,26 @@ formatGoldenTest fp = cabalGoldenTest "format" correct $ do
288288

289289
#ifdef MIN_VERSION_tree_diff
290290
treeDiffGoldenTest :: FilePath -> TestTree
291-
treeDiffGoldenTest fp =
292-
let go label f = ediffGolden goldenTest label exprFile $ do
293-
contents <- BS.readFile input
294-
let res = withSource (PCabalFile (fp, contents)) $ parseGenericPackageDescription contents
295-
let (_, x) = runParseResult res
296-
case x of
297-
Right gpd -> pure (toExpr $ f gpd)
298-
Left (_, errs) -> fail $ unlines $ "ERROR" : map (showPErrorWithSource . fmap renderCabalFileSource) (NE.toList errs)
299-
where
300-
input = "tests" </> "ParserTests" </> "regressions" </> fp
301-
exprFile = replaceExtension input (label <> ".expr")
302-
in testGroup "expr"
303-
[ go "packageDescription" packageDescription
304-
, go "gpdScannedVersion" gpdScannedVersion
305-
, go "genPackageFlags" genPackageFlags
306-
-- Test accessors because they encapsulate the merging behaviour
307-
, go "condLibrary" condLibrary
308-
, go "condSubLibraries" condSubLibraries
309-
, go "condForeignLibs" condForeignLibs
310-
, go "condExecutables" condExecutables
311-
, go "condTestSuites" condTestSuites
312-
, go "condBenchmarks" condBenchmarks
313-
]
291+
treeDiffGoldenTest fp = ediffGolden goldenTest "expr" exprFile $ do
292+
contents <- BS.readFile input
293+
let res = withSource (PCabalFile (fp, contents)) $ parseGenericPackageDescription contents
294+
let (_, x) = runParseResult res
295+
case x of
296+
Right gpd -> pure $ toExpr
297+
( packageDescription gpd
298+
, gpdScannedVersion gpd
299+
, genPackageFlags gpd
300+
, condLibrary gpd
301+
, condSubLibraries gpd
302+
, condForeignLibs gpd
303+
, condExecutables gpd
304+
, condTestSuites gpd
305+
, condBenchmarks gpd
306+
)
307+
Left (_, errs) -> fail $ unlines $ "ERROR" : map (showPErrorWithSource . fmap renderCabalFileSource) (NE.toList errs)
308+
where
309+
input = "tests" </> "ParserTests" </> "regressions" </> fp
310+
exprFile = replaceExtension input "expr"
314311
#endif
315312

316313
formatRoundTripTest :: FilePath -> TestTree

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condBenchmarks.expr

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condExecutables.expr

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condForeignLibs.expr

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condLibrary.expr

Lines changed: 0 additions & 109 deletions
This file was deleted.

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condSubLibraries.expr

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cabal-tests/tests/ParserTests/regressions/Octree-0.5.condTestSuites.expr

Lines changed: 0 additions & 219 deletions
This file was deleted.

0 commit comments

Comments
 (0)