From f494fe1b23f8954039918f0d217776d7e81c92e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Apr 2020 20:28:52 +0200 Subject: [PATCH] Normalise Filepaths for target matching --- cabal-install/Distribution/Client/TargetSelector.hs | 1 + cabal-install/tests/IntegrationTests2.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cabal-install/Distribution/Client/TargetSelector.hs b/cabal-install/Distribution/Client/TargetSelector.hs index 407a98e51a7..db5ace5cc92 100644 --- a/cabal-install/Distribution/Client/TargetSelector.hs +++ b/cabal-install/Distribution/Client/TargetSelector.hs @@ -2124,6 +2124,7 @@ matchComponentOtherFile cs = ++ cinfoCFiles c ++ cinfoJsFiles c ] + . normalise matchComponentModuleFile :: [KnownComponent] -> String diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index 06bd889fe7c..ec276ac4621 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -255,7 +255,7 @@ testTargetSelectors reportSubCase = do ts @?= replicate 5 (TargetComponent "p-0.1" (CLibName LMainLibName) (FileTarget "P")) ++ replicate 5 (TargetComponent "q-0.1" (CLibName LMainLibName) (FileTarget "QQ")) ++ replicate 5 (TargetComponent "q-0.1" (CLibName LMainLibName) (FileTarget "Q")) - ++ replicate 5 (TargetComponent "p-0.1" (CExeName "ppexe") (FileTarget "app/Main.hs")) + ++ replicate 5 (TargetComponent "p-0.1" (CExeName "ppexe") (FileTarget ("app" "Main.hs"))) -- Note there's a bit of an inconsistency here: for the single-part -- syntax the target has to point to a file that exists, whereas for -- all the other forms we don't require that.