aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ghc-hpack-fix-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/ghc-hpack-fix-tests.patch')
-rw-r--r--gnu/packages/patches/ghc-hpack-fix-tests.patch193
1 files changed, 193 insertions, 0 deletions
diff --git a/gnu/packages/patches/ghc-hpack-fix-tests.patch b/gnu/packages/patches/ghc-hpack-fix-tests.patch
new file mode 100644
index 0000000000..19aa762174
--- /dev/null
+++ b/gnu/packages/patches/ghc-hpack-fix-tests.patch
@@ -0,0 +1,193 @@
+This patch is taken and adapted from upstream. It landed shortly after
+the release of 0.31.2, and fixes eleven tests. The patch has been
+lightly adapted to apply to the release tarball, but the commit message
+was left untouched, so it refers to some changes not included in the
+patch.
+
+From a8d9362d4b686074f698c04c20beea88587511a1 Mon Sep 17 00:00:00 2001
+From: quasicomputational <quasicomputational@gmail.com>
+Date: Sat, 1 Jun 2019 15:11:31 +0100
+Subject: [PATCH] Make CI green (#345)
+
+* AppVeyor workaround for TMP issue
+
+https://github.com/commercialhaskell/stack/issues/3944
+
+* Bump resolver to nightly-2018-12-12.
+
+This has the primary benefit of moving to GHC 8.6.3 and should fix
+AppVeyor.
+
+* Add clock 0.8 as an extra-dep.
+
+* Adapt expected output to aeson 1.4.3.0.
+---
+ appveyor.yml | 3 +++
+ hpack.cabal | 10 +++++-----
+ package.yaml | 2 +-
+ stack.yaml | 5 +++--
+ test/Data/Aeson/Config/FromValueSpec.hs | 2 +-
+ test/Data/Aeson/Config/TypesSpec.hs | 2 +-
+ test/EndToEndSpec.hs | 8 ++++----
+ test/Hpack/ConfigSpec.hs | 2 +-
+ test/Hpack/Syntax/DefaultsSpec.hs | 2 +-
+ test/Hpack/Syntax/DependenciesSpec.hs | 4 ++--
+ 10 files changed, 22 insertions(+), 18 deletions(-)
+
+diff --git a/hpack.cabal b/hpack.cabal
+index fedb9a8..4db3014 100644
+--- a/hpack.cabal
++++ b/hpack.cabal
+@@ -1,10 +1,10 @@
+ cabal-version: 1.12
+
+--- This file has been generated from package.yaml by hpack version 0.31.0.
++-- This file has been generated from package.yaml by hpack version 0.31.2.
+ --
+ -- see: https://github.com/sol/hpack
+ --
+--- hash: 3d060180293c32b8d0c25b710d0f419e96a6cc6ec3f95ac5e70bb77f44cbafc3
++-- hash: bd5dd178c7e9f7f7a3456d79b592ea336c41ef43c9892354c001f06659e8b901
+
+ name: hpack
+ version: 0.31.2
+@@ -31,7 +31,7 @@ library
+ build-depends:
+ Cabal >=2.2
+ , Glob >=0.9.0
+- , aeson >=1.2.1.0
++ , aeson >=1.4.3.0
+ , base >=4.9 && <5
+ , bifunctors
+ , bytestring
+@@ -87,7 +87,7 @@ executable hpack
+ build-depends:
+ Cabal >=2.2
+ , Glob >=0.9.0
+- , aeson >=1.2.1.0
++ , aeson >=1.4.3.0
+ , base >=4.9 && <5
+ , bifunctors
+ , bytestring
+@@ -125,7 +125,7 @@ test-suite spec
+ , Glob >=0.9.0
+ , HUnit >=1.6.0.0
+ , QuickCheck
+- , aeson >=1.2.1.0
++ , aeson >=1.4.3.0
+ , base >=4.9 && <5
+ , bifunctors
+ , bytestring
+diff --git a/test/Data/Aeson/Config/FromValueSpec.hs b/test/Data/Aeson/Config/FromValueSpec.hs
+index 33de8b7..06b3eb9 100644
+--- a/test/Data/Aeson/Config/FromValueSpec.hs
++++ b/test/Data/Aeson/Config/FromValueSpec.hs
+@@ -85,7 +85,7 @@ spec = do
+ [yaml|
+ name: "Joe"
+ age: "23"
+- |] `shouldDecodeTo` left "Error while parsing $.age - expected Int, encountered String"
++ |] `shouldDecodeTo` left "Error while parsing $.age - parsing Int failed, expected Number, but encountered String"
+
+ context "with (,)" $ do
+ it "captures unrecognized fields" $ do
+diff --git a/test/Data/Aeson/Config/TypesSpec.hs b/test/Data/Aeson/Config/TypesSpec.hs
+index c954534..472aa42 100644
+--- a/test/Data/Aeson/Config/TypesSpec.hs
++++ b/test/Data/Aeson/Config/TypesSpec.hs
+@@ -13,7 +13,7 @@ spec = do
+ context "List" $ do
+ let
+ parseError :: String -> Result (List Int)
+- parseError prefix = Left (prefix ++ " - expected Int, encountered String")
++ parseError prefix = Left (prefix ++ " - parsing Int failed, expected Number, but encountered String")
+
+ context "when parsing single values" $ do
+ it "returns the value in a singleton list" $ do
+diff --git a/test/EndToEndSpec.hs b/test/EndToEndSpec.hs
+index 283c72c..46389ea 100644
+--- a/test/EndToEndSpec.hs
++++ b/test/EndToEndSpec.hs
+@@ -285,7 +285,7 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
+ path: defaults.yaml
+ ref: "2017"
+ library: {}
+- |] `shouldFailWith` (file ++ ": Error while parsing $ - expected Object, encountered Array")
++ |] `shouldFailWith` (file ++ ": Error while parsing $ - expected Object, but encountered Array")
+
+ it "warns on unknown fields" $ do
+ let file = joinPath ["defaults", "sol", "hpack-template", "2017", "defaults.yaml"]
+@@ -340,7 +340,7 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
+ it "rejects other values" $ do
+ [i|
+ version: {}
+- |] `shouldFailWith` "package.yaml: Error while parsing $.version - expected Number or String, encountered Object"
++ |] `shouldFailWith` "package.yaml: Error while parsing $.version - expected Number or String, but encountered Object"
+
+ describe "license" $ do
+ it "accepts cabal-style licenses" $ do
+@@ -1363,14 +1363,14 @@ spec = around_ (inTempDirectoryNamed "foo") $ do
+ then:
+ dependencies: Win32
+ else: null
+- |] `shouldFailWith` "package.yaml: Error while parsing $.when.else - expected Object, encountered Null"
++ |] `shouldFailWith` "package.yaml: Error while parsing $.when.else - expected Object, but encountered Null"
+
+ it "rejects invalid conditionals" $ do
+ [i|
+ dependencies:
+ - foo
+ - 23
+- |] `shouldFailWith` "package.yaml: Error while parsing $.dependencies[1] - expected Object or String, encountered Number"
++ |] `shouldFailWith` "package.yaml: Error while parsing $.dependencies[1] - expected Object or String, but encountered Number"
+
+ it "warns on unknown fields" $ do
+ [i|
+diff --git a/test/Hpack/ConfigSpec.hs b/test/Hpack/ConfigSpec.hs
+index 9f4b279..69cbea1 100644
+--- a/test/Hpack/ConfigSpec.hs
++++ b/test/Hpack/ConfigSpec.hs
+@@ -675,7 +675,7 @@ spec = do
+ it "rejects other values" $ do
+ [yaml|
+ 23
+- |] `shouldDecodeTo` (Left "Error while parsing $ - expected Boolean or String, encountered Number" :: Result Cond)
++ |] `shouldDecodeTo` (Left "Error while parsing $ - expected Boolean or String, but encountered Number" :: Result Cond)
+
+ describe "formatOrList" $ do
+ it "formats a singleton list" $ do
+diff --git a/test/Hpack/Syntax/DefaultsSpec.hs b/test/Hpack/Syntax/DefaultsSpec.hs
+index 5875413..5438b7a 100644
+--- a/test/Hpack/Syntax/DefaultsSpec.hs
++++ b/test/Hpack/Syntax/DefaultsSpec.hs
+@@ -151,4 +151,4 @@ spec = do
+ it "fails" $ do
+ [yaml|
+ 10
+- |] `shouldDecodeTo` left "Error while parsing $ - expected Object or String, encountered Number"
++ |] `shouldDecodeTo` left "Error while parsing $ - expected Object or String, but encountered Number"
+diff --git a/test/Hpack/Syntax/DependenciesSpec.hs b/test/Hpack/Syntax/DependenciesSpec.hs
+index 1a83732..d95044f 100644
+--- a/test/Hpack/Syntax/DependenciesSpec.hs
++++ b/test/Hpack/Syntax/DependenciesSpec.hs
+@@ -125,7 +125,7 @@ spec = do
+ it "rejects invalid values" $ do
+ [yaml|
+ hpack: []
+- |] `shouldDecodeTo` left "Error while parsing $.hpack - expected Null, Object, Number, or String, encountered Array"
++ |] `shouldDecodeTo` left "Error while parsing $.hpack - expected Null, Object, Number, or String, but encountered Array"
+
+ context "when the constraint is a Number" $ do
+ it "accepts 1" $ do
+@@ -213,7 +213,7 @@ spec = do
+ [yaml|
+ foo:
+ version: {}
+- |] `shouldDecodeTo` left "Error while parsing $.foo.version - expected Null, Number, or String, encountered Object"
++ |] `shouldDecodeTo` left "Error while parsing $.foo.version - expected Null, Number, or String, but encountered Object"
+
+ it "accepts a string" $ do
+ [yaml|
+--
+2.23.0
+