@@ -58,6 +58,15 @@ Example of lines:
58
58
" z"
59
59
" ^ ^ ^" ))
60
60
61
+ (ert-deftest haskell-indentation-check-2-unicode ()
62
+ :expected-result :failed
63
+ " Handle underscore in identifiers (unicode)"
64
+ (haskell-indentation-check
65
+ " function = do"
66
+ " (_x) ← return ()"
67
+ " z"
68
+ " ^ ^ ^" ))
69
+
61
70
(ert-deftest haskell-indentation-check-2a ()
62
71
" Handle apostrophe in identifiers"
63
72
(haskell-indentation-check
@@ -66,6 +75,14 @@ Example of lines:
66
75
" z"
67
76
" ^ ^ ^" ))
68
77
78
+ (ert-deftest haskell-indentation-check-2a-unicode ()
79
+ " Handle apostrophe in identifiers (unicode)"
80
+ :expected-result :failed
81
+ (haskell-indentation-check
82
+ " function = do"
83
+ " (_'x') ← return ()"
84
+ " z"
85
+ " ^ ^ ^" ))
69
86
70
87
(ert-deftest haskell-indentation-check-3 ()
71
88
" Import statememnt symbol list 1"
@@ -108,6 +125,16 @@ Example of lines:
108
125
" , f <- fx x y c ]"
109
126
" ^" ))
110
127
128
+ (ert-deftest haskell-indentation-check-6-unicode ()
129
+ " let in list comprehension (unicode)"
130
+ :expected-result :failed
131
+ (haskell-indentation-check
132
+ " fun = [ f | x ← xs"
133
+ " , y ← ys"
134
+ " , let c = 123"
135
+ " , f ← fx x y c ]"
136
+ " ^" ))
137
+
111
138
(ert-deftest haskell-indentation-check-7 ()
112
139
" import after import"
113
140
:expected-result :failed
@@ -147,6 +174,15 @@ Example of lines:
147
174
" , Just val2 <- lookup env var2"
148
175
" ^" ))
149
176
177
+ (ert-deftest haskell-indentation-check-11-unicode ()
178
+ :expected-result :failed
179
+ " Guards with commas (unicode)"
180
+ (haskell-indentation-check
181
+ " clunky env var1 var2"
182
+ " | Just val1 ← lookup env var1"
183
+ " , Just val2 ← lookup env var2"
184
+ " ^" ))
185
+
150
186
(ert-deftest haskell-indentation-check-12 ()
151
187
" Guards with commas"
152
188
:expected-result :failed
@@ -189,13 +225,27 @@ Example of lines:
189
225
" fun = \x -> do"
190
226
" ^" ))
191
227
228
+ (ert-deftest haskell-indentation-check-16-unicode ()
229
+ " Lambda and a do block (unicode)"
230
+ :expected-result :failed
231
+ (haskell-indentation-check
232
+ " fun = \x → do"
233
+ " ^" ))
234
+
192
235
(ert-deftest haskell-indentation-check-16a ()
193
236
" A lambda"
194
237
:expected-result :failed
195
238
(haskell-indentation-check
196
239
" fun = \x ->"
197
240
" ^" ))
198
241
242
+ (ert-deftest haskell-indentation-check-16a-unicode ()
243
+ " A lambda (unicode)"
244
+ :expected-result :failed
245
+ (haskell-indentation-check
246
+ " fun = \x →"
247
+ " ^" ))
248
+
199
249
(ert-deftest haskell-indentation-check-17a ()
200
250
" A type for a function"
201
251
:expected-result :failed
@@ -212,6 +262,14 @@ Example of lines:
212
262
" => Int"
213
263
" ^" ))
214
264
265
+ (ert-deftest haskell-indentation-check-17b-unicode ()
266
+ " A type for a function with context (unicode)"
267
+ :expected-result :failed
268
+ (haskell-indentation-check
269
+ " fun ∷ Monad m"
270
+ " ⇒ Int"
271
+ " ^" ))
272
+
215
273
(ert-deftest haskell-indentation-check-17c ()
216
274
" A type for a function with complicated context"
217
275
:expected-result :failed
@@ -220,6 +278,14 @@ Example of lines:
220
278
" => MyMonad (A v) m"
221
279
" ^" ))
222
280
281
+ (ert-deftest haskell-indentation-check-17c-unicode ()
282
+ " A type for a function with complicated context (unicode)"
283
+ :expected-result :failed
284
+ (haskell-indentation-check
285
+ " fun ∷ (Monad m, MonadBaseControl IO m, MyMonad (A v) m)"
286
+ " ⇒ MyMonad (A v) m"
287
+ " ^" ))
288
+
223
289
(ert-deftest haskell-indentation-check-17d ()
224
290
" A type for a function with param and a complicated context"
225
291
:expected-result :failed
@@ -229,6 +295,15 @@ Example of lines:
229
295
" -> m (Maybe a)"
230
296
" ^" ))
231
297
298
+ (ert-deftest haskell-indentation-check-17d-unicode ()
299
+ " A type for a function with param and a complicated context (unicode)"
300
+ :expected-result :failed
301
+ (haskell-indentation-check
302
+ " fun ∷ (Monad m, MonadBaseControl IO m, MyMonad (A v) m)"
303
+ " ⇒ MyMonad (A v) m"
304
+ " → m (Maybe a)"
305
+ " ^" ))
306
+
232
307
(ert-deftest haskell-indentation-check-18a ()
233
308
" if then else indentation: then"
234
309
(haskell-indentation-check
@@ -321,6 +396,13 @@ Example of lines:
321
396
" c = undefined"
322
397
" ^" ))
323
398
399
+ (ert-deftest haskell-indentation-check-instance-20b-unicode ()
400
+ " instance declaration (unicode)"
401
+ (haskell-indentation-check
402
+ " instance (Monad m) ⇒ C m a where"
403
+ " c = undefined"
404
+ " ^" ))
405
+
324
406
(ert-deftest haskell-indentation-check-instance-21a ()
325
407
" layout versus comma in braces"
326
408
(haskell-indentation-check
@@ -330,3 +412,13 @@ Example of lines:
330
412
" bar = 0"
331
413
" , baz = 0"
332
414
" ^" ))
415
+
416
+ (ert-deftest haskell-indentation-check-instance-21a-unicode ()
417
+ " layout versus comma in braces (unicode)"
418
+ (haskell-indentation-check
419
+ " main ∷ IO ()"
420
+ " main = do"
421
+ " let foo = Foo {"
422
+ " bar = 0"
423
+ " , baz = 0"
424
+ " ^" ))
0 commit comments