1
1
import Test.Cabal.Prelude
2
2
import Test.Cabal.OutputNormalizer
3
3
import Data.Function ((&) )
4
+ import Data.Functor ((<&>) )
4
5
5
6
main = cabalTest . withRepo " repo" . recordMode RecordMarked $ do
6
7
let log = recordHeader . pure
@@ -78,7 +79,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
78
79
-- +-- etc
79
80
log " checking that cyclical check catches a same file name that imports itself"
80
81
cyclical4a <- fails $ cabal' " v2-build" [ " --project-file=cyclical-same-filename-out-out-self.project" ]
81
- assertOutputContains (normalizeWindowsOutput " cyclical import of same-filename/cyclical-same-filename-out-out-self.config" ) cyclical4a
82
+ assertOutputContains (normalizePathSeparators " cyclical import of same-filename/cyclical-same-filename-out-out-self.config" ) cyclical4a
82
83
83
84
-- +-- cyclical-same-filename-out-out-backback.project
84
85
-- +-- cyclical-same-filename-out-out-backback.config
@@ -111,64 +112,8 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
111
112
log " checking that imports work skipping into a subfolder and then back out again and again"
112
113
hopping <- cabal' " v2-build" [ " --project-file=hops-0.project" ]
113
114
114
- " Configuration is affected by the following files:\n \
115
- \- hops-0.project\n \
116
- \- hops-2.config\n \
117
- \ imported by: hops/hops-1.config\n \
118
- \ imported by: hops-0.project\n \
119
- \- hops-4.config\n \
120
- \ imported by: hops/hops-3.config\n \
121
- \ imported by: hops-2.config\n \
122
- \ imported by: hops/hops-1.config\n \
123
- \ imported by: hops-0.project\n \
124
- \- hops-6.config\n \
125
- \ imported by: hops/hops-5.config\n \
126
- \ imported by: hops-4.config\n \
127
- \ imported by: hops/hops-3.config\n \
128
- \ imported by: hops-2.config\n \
129
- \ imported by: hops/hops-1.config\n \
130
- \ imported by: hops-0.project\n \
131
- \- hops-8.config\n \
132
- \ imported by: hops/hops-7.config\n \
133
- \ imported by: hops-6.config\n \
134
- \ imported by: hops/hops-5.config\n \
135
- \ imported by: hops-4.config\n \
136
- \ imported by: hops/hops-3.config\n \
137
- \ imported by: hops-2.config\n \
138
- \ imported by: hops/hops-1.config\n \
139
- \ imported by: hops-0.project\n \
140
- \- hops/hops-1.config\n \
141
- \ imported by: hops-0.project\n \
142
- \- hops/hops-3.config\n \
143
- \ imported by: hops-2.config\n \
144
- \ imported by: hops/hops-1.config\n \
145
- \ imported by: hops-0.project\n \
146
- \- hops/hops-5.config\n \
147
- \ imported by: hops-4.config\n \
148
- \ imported by: hops/hops-3.config\n \
149
- \ imported by: hops-2.config\n \
150
- \ imported by: hops/hops-1.config\n \
151
- \ imported by: hops-0.project\n \
152
- \- hops/hops-7.config\n \
153
- \ imported by: hops-6.config\n \
154
- \ imported by: hops/hops-5.config\n \
155
- \ imported by: hops-4.config\n \
156
- \ imported by: hops/hops-3.config\n \
157
- \ imported by: hops-2.config\n \
158
- \ imported by: hops/hops-1.config\n \
159
- \ imported by: hops-0.project\n \
160
- \- hops/hops-9.config\n \
161
- \ imported by: hops-8.config\n \
162
- \ imported by: hops/hops-7.config\n \
163
- \ imported by: hops-6.config\n \
164
- \ imported by: hops/hops-5.config\n \
165
- \ imported by: hops-4.config\n \
166
- \ imported by: hops/hops-3.config\n \
167
- \ imported by: hops-2.config\n \
168
- \ imported by: hops/hops-1.config\n \
169
- \ imported by: hops-0.project"
170
- & normalizeWindowsOutput
171
- & flip (assertOn multilineNeedleHaystack) hopping
115
+ readFileVerbatim " hops.expect.txt" >>=
116
+ flip (assertOn multilineNeedleHaystack) hopping . normalizePathSeparators
172
117
173
118
-- The project is named oops as it is like hops but has conflicting constraints.
174
119
-- +-- oops-0.project
@@ -184,24 +129,8 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
184
129
log " checking conflicting constraints skipping into a subfolder and then back out again and again"
185
130
oopsing <- fails $ cabal' " v2-build" [ " all" , " --project-file=oops-0.project" ]
186
131
187
- " Could not resolve dependencies:\n \
188
- \[__0] trying: oops-0.1 (user goal)\n \
189
- \[__1] next goal: hashable (dependency of oops)\n \
190
- \[__1] rejecting: hashable-1.4.3.0\n \
191
- \ (constraint from oops/oops-9.config requires ==1.4.2.0)\n \
192
- \ imported by: oops-8.config\n \
193
- \ imported by: oops/oops-7.config\n \
194
- \ imported by: oops-6.config\n \
195
- \ imported by: oops/oops-5.config\n \
196
- \ imported by: oops-4.config\n \
197
- \ imported by: oops/oops-3.config\n \
198
- \ imported by: oops-2.config\n \
199
- \ imported by: oops/oops-1.config\n \
200
- \ imported by: oops-0.project\n \
201
- \[__1] rejecting: hashable-1.4.2.0\n \
202
- \ (constraint from oops-0.project requires ==1.4.3.0)"
203
- & normalizeWindowsOutput
204
- & flip (assertOn multilineNeedleHaystack) oopsing
132
+ readFileVerbatim " oops.expect.txt"
133
+ >>= flip (assertOn multilineNeedleHaystack) oopsing . normalizePathSeparators
205
134
206
135
log " checking bad conditional"
207
136
badIf <- fails $ cabal' " v2-build" [ " --project-file=bad-conditional.project" ]
@@ -210,13 +139,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
210
139
log " checking that missing package message lists configuration provenance"
211
140
missing <- fails $ cabal' " v2-build" [ " --project-file=cabal-missing-package.project" ]
212
141
213
- " When using configuration from:\n \
214
- \ - cabal-missing-package.project\n \
215
- \ - missing/pkgs.config\n \
216
- \ - missing/pkgs/default.config\n \
217
- \The following errors occurred:\n \
218
- \ - The package location 'pkg-doesnt-exist' does not exist."
219
- & normalizeWindowsOutput
220
- & flip (assertOn multilineNeedleHaystack) missing
142
+ readFileVerbatim " cabal-missing-package.expect.txt"
143
+ >>= flip (assertOn multilineNeedleHaystack) missing . normalizePathSeparators
221
144
222
145
return ()
0 commit comments