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