summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ghc-hpack-fix-tests.patch
blob: 19aa762174f5287b6cf3e85d251e569e7d41c5ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
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