aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2018-10-14 18:56:06 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2018-10-14 18:56:06 +0300
commit9c5cb27828bcc3cbe505fba8ef8e6db0e87d2a9c (patch)
treed558ebcf13b4f5d42d27efea30e5f5697a0f456f /test
parent1b8661d36ce9dcbcd5a833a79357445fe734426d (diff)
parent2b5cbccffa21d9f80f804bd9d95d4527ce3246b7 (diff)
Merge branch 'ghc-8.4.3'
Diffstat (limited to 'test')
-rw-r--r--test/Main.hs24
-rw-r--r--test/test-package/stack-8.2.2.yaml1
-rw-r--r--test/test-package/stack.yaml2
3 files changed, 19 insertions, 8 deletions
diff --git a/test/Main.hs b/test/Main.hs
index f2247fb..11b94fb 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -140,17 +140,25 @@ moduleInfoSpec modInfo =
it "returns valid map of identifiers " $
let removeLocationInfo :: HCE.LocationInfo -> HCE.LocationInfo
removeLocationInfo _ = HCE.UnknownLocation ""
- in U.transformBi
- removeLocationInfo
- (HCE.idInfoMap (modInfo :: HCE.ModuleInfo)) `shouldBe`
- U.transformBi removeLocationInfo testIdInfoMap
+ removePackageVersionFromExternalId :: HCE.ExternalId -> HCE.ExternalId
+ removePackageVersionFromExternalId extId@(HCE.ExternalId textId) = case T.splitOn "|" textId of
+ packageId:rest -> case T.splitOn "-" packageId of
+ packageIdParts@(_:_) -> HCE.ExternalId $ T.intercalate "|" ((T.intercalate "-" (init packageIdParts)) : rest)
+ _ -> extId
+ _ -> extId
+ cleanup :: HCE.IdentifierInfoMap -> HCE.IdentifierInfoMap
+ cleanup = U.transformBi removeLocationInfo . U.transformBi removePackageVersionFromExternalId
+ in
+ cleanup (HCE.idInfoMap (modInfo :: HCE.ModuleInfo)) `shouldBe` cleanup testIdInfoMap
#endif
it "returns valid map of identifier occurrences" $
HCE.idOccMap (modInfo :: HCE.ModuleInfo) `shouldBe` testIdOccMap
-stackYamlArg :: [String]
-#if MIN_VERSION_GLASGOW_HASKELL(8,2,2,0)
+stackYamlArg :: [String]
+#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
stackYamlArg = []
+#elif MIN_VERSION_GLASGOW_HASKELL(8,2,2,0)
+stackYamlArg = ["--stack-yaml=stack-8.2.2.yaml" ]
#else
stackYamlArg = ["--stack-yaml=stack-8.0.2.yaml" ]
#endif
@@ -177,7 +185,7 @@ buildAndIndexTestPackage currentDir = do
_ <-
readProcess
stackExecutable
- (["build", "--test"] ++ stackYamlArg)
+ (["build", "--test","--force-dirty"] ++ stackYamlArg)
""
runLoggingT
(createPackageInfo
@@ -1209,3 +1217,5 @@ testIdInfoMap =
, isExported = False
})
]
+
+
diff --git a/test/test-package/stack-8.2.2.yaml b/test/test-package/stack-8.2.2.yaml
new file mode 100644
index 0000000..5bad591
--- /dev/null
+++ b/test/test-package/stack-8.2.2.yaml
@@ -0,0 +1 @@
+resolver: lts-11.3
diff --git a/test/test-package/stack.yaml b/test/test-package/stack.yaml
index 5bad591..80a9a5a 100644
--- a/test/test-package/stack.yaml
+++ b/test/test-package/stack.yaml
@@ -1 +1 @@
-resolver: lts-11.3
+resolver: lts-12.12