From 1d7e29b7ea94ae35c3a4e8211dc072d2a12162db Mon Sep 17 00:00:00 2001 From: Oleg Grenrus <oleg.grenrus@iki.fi> Date: Thu, 28 Nov 2019 02:34:22 +0200 Subject: [PATCH] Add test for #6083, build-depends: pkg:pkg I'm adding this test, so we dont' silently change the behaviour for `cabal-version: 3.0` --- Cabal/tests/ParserTests.hs | 1 + .../regressions/issue6083-pkg-pkg.cabal | 9 ++ .../regressions/issue6083-pkg-pkg.expr | 111 ++++++++++++++++++ .../regressions/issue6083-pkg-pkg.format | 9 ++ 4 files changed, 130 insertions(+) create mode 100644 Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.cabal create mode 100644 Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.expr create mode 100644 Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.format diff --git a/Cabal/tests/ParserTests.hs b/Cabal/tests/ParserTests.hs index e93108137d..0a5e9ca451 100644 --- a/Cabal/tests/ParserTests.hs +++ b/Cabal/tests/ParserTests.hs @@ -181,6 +181,7 @@ regressionTests = testGroup "regressions" , regressionTest "indentation.cabal" , regressionTest "indentation2.cabal" , regressionTest "indentation3.cabal" + , regressionTest "issue6083-pkg-pkg.cabal" ] regressionTest :: FilePath -> TestTree diff --git a/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.cabal b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.cabal new file mode 100644 index 0000000000..827834afc2 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.cabal @@ -0,0 +1,9 @@ +cabal-version: 3.0 +name: issue +version: 6083 + +library + default-language: Haskell2010 + -- This should be parsed as the main lib + build-depends: freetype + build-depends: freetype:freetype diff --git a/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.expr b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.expr new file mode 100644 index 0000000000..9192103977 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.expr @@ -0,0 +1,111 @@ +GenericPackageDescription + {condBenchmarks = [], + condExecutables = [], + condForeignLibs = [], + condLibrary = Just + CondNode + {condTreeComponents = [], + condTreeConstraints = [Dependency + `PackageName "freetype"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "freetype"` + AnyVersion + (Set.fromList [LMainLibName])], + condTreeData = Library + {exposedModules = [], + libBuildInfo = BuildInfo + {asmOptions = [], + asmSources = [], + autogenIncludes = [], + autogenModules = [], + buildToolDepends = [], + buildTools = [], + buildable = True, + cSources = [], + ccOptions = [], + cmmOptions = [], + cmmSources = [], + cppOptions = [], + customFieldsBI = [], + cxxOptions = [], + cxxSources = [], + defaultExtensions = [], + defaultLanguage = Just Haskell2010, + extraBundledLibs = [], + extraDynLibFlavours = [], + extraFrameworkDirs = [], + extraGHCiLibs = [], + extraLibDirs = [], + extraLibFlavours = [], + extraLibs = [], + frameworks = [], + hsSourceDirs = [], + includeDirs = [], + includes = [], + installIncludes = [], + jsSources = [], + ldOptions = [], + mixins = [], + oldExtensions = [], + options = PerCompilerFlavor [] [], + otherExtensions = [], + otherLanguages = [], + otherModules = [], + pkgconfigDepends = [], + profOptions = PerCompilerFlavor [] [], + sharedOptions = PerCompilerFlavor [] [], + staticOptions = PerCompilerFlavor [] [], + targetBuildDepends = [Dependency + `PackageName "freetype"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "freetype"` + AnyVersion + (Set.fromList + [LMainLibName])], + virtualModules = []}, + libExposed = True, + libName = LMainLibName, + libVisibility = LibraryVisibilityPublic, + reexportedModules = [], + signatures = []}}, + condSubLibraries = [], + condTestSuites = [], + genPackageFlags = [], + packageDescription = PackageDescription + {author = "", + benchmarks = [], + bugReports = "", + buildTypeRaw = Nothing, + category = "", + copyright = "", + customFieldsPD = [], + dataDir = "", + dataFiles = [], + description = "", + executables = [], + extraDocFiles = [], + extraSrcFiles = [], + extraTmpFiles = [], + foreignLibs = [], + homepage = "", + library = Nothing, + licenseFiles = [], + licenseRaw = Left NONE, + maintainer = "", + package = PackageIdentifier + {pkgName = `PackageName "issue"`, + pkgVersion = `mkVersion [6083]`}, + pkgUrl = "", + setupBuildInfo = Nothing, + sourceRepos = [], + specVersionRaw = Left `mkVersion [3,0]`, + stability = "", + subLibraries = [], + synopsis = "", + testSuites = [], + testedWith = []}} diff --git a/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.format b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.format new file mode 100644 index 0000000000..da7fecdf60 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/issue6083-pkg-pkg.format @@ -0,0 +1,9 @@ +cabal-version: 3.0 +name: issue +version: 6083 + +library + default-language: Haskell2010 + build-depends: + freetype -any, + freetype -any -- GitLab