Skip to content

Commit

Permalink
Add test for #6083, build-depends: pkg:pkg
Browse files Browse the repository at this point in the history
I'm adding this test, so we dont' silently change the behaviour
for `cabal-version: 3.0`
  • Loading branch information
phadej committed Nov 28, 2019
1 parent 0741375 commit daea7a0
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ extra-source-files:
tests/ParserTests/regressions/issue-5846.cabal
tests/ParserTests/regressions/issue-5846.expr
tests/ParserTests/regressions/issue-5846.format
tests/ParserTests/regressions/issue-6083-pkg-pkg.cabal
tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
tests/ParserTests/regressions/issue-6083-pkg-pkg.format
tests/ParserTests/regressions/issue-774.cabal
tests/ParserTests/regressions/issue-774.check
tests/ParserTests/regressions/issue-774.expr
Expand Down
1 change: 1 addition & 0 deletions Cabal/tests/ParserTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ regressionTests = testGroup "regressions"
, regressionTest "wl-pprint-indef.cabal"
, regressionTest "th-lift-instances.cabal"
, regressionTest "issue-5055.cabal"
, regressionTest "issue-6083-pkg-pkg.cabal"
, regressionTest "noVersion.cabal"
, regressionTest "spdx-1.cabal"
, regressionTest "spdx-2.cabal"
Expand Down
9 changes: 9 additions & 0 deletions Cabal/tests/ParserTests/regressions/issue-6083-pkg-pkg.cabal
Original file line number Diff line number Diff line change
@@ -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
111 changes: 111 additions & 0 deletions Cabal/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
Original file line number Diff line number Diff line change
@@ -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 = []}}
9 changes: 9 additions & 0 deletions Cabal/tests/ParserTests/regressions/issue-6083-pkg-pkg.format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cabal-version: 3.0
name: issue
version: 6083

library
default-language: Haskell2010
build-depends:
freetype -any,
freetype -any

0 comments on commit daea7a0

Please sign in to comment.