@@ -198,29 +198,125 @@ Example of lines:
198198
199199(ert-deftest haskell-indentation-check-17a ()
200200 " A type for a function"
201+ :expected-result :failed
201202 (haskell-indentation-check
202203 " fun :: Int"
203204 " -> Int"
204205 " ^" ))
205206
206207(ert-deftest haskell-indentation-check-17b ()
207208 " A type for a function with context"
209+ :expected-result :failed
208210 (haskell-indentation-check
209211 " fun :: Monad m"
210212 " => Int"
211213 " ^" ))
212214
213215(ert-deftest haskell-indentation-check-17c ()
214216 " A type for a function with complicated context"
217+ :expected-result :failed
215218 (haskell-indentation-check
216219 " fun :: (Monad m, MonadBaseControl IO m, MyMonad (A v) m)"
217220 " => MyMonad (A v) m"
218221 " ^" ))
219222
220223(ert-deftest haskell-indentation-check-17d ()
221224 " A type for a function with param and a complicated context"
225+ :expected-result :failed
222226 (haskell-indentation-check
223227 " fun :: (Monad m, MonadBaseControl IO m, MyMonad (A v) m)"
224228 " => MyMonad (A v) m"
225229 " -> m (Maybe a)"
226230 " ^" ))
231+
232+ (ert-deftest haskell-indentation-check-18a ()
233+ " if then else indentation: then"
234+ (haskell-indentation-check
235+ " x = if flag"
236+ " then 1"
237+ " ^" ))
238+
239+ (ert-deftest haskell-indentation-check-18b ()
240+ " if then else indentation: else"
241+ (haskell-indentation-check
242+ " x = if flag"
243+ " then 1"
244+ " else 0"
245+ " ^" ))
246+
247+ (ert-deftest haskell-indentation-check-18c ()
248+ " do and if then else indentation: then"
249+ (haskell-indentation-check
250+ " x = do"
251+ " if flag"
252+ " then 1"
253+ " ^" ))
254+
255+ (ert-deftest haskell-indentation-check-18d ()
256+ " do and if then else indentation: else"
257+ (haskell-indentation-check
258+ " x = do"
259+ " if flag"
260+ " then 1"
261+ " else 0"
262+ " ^" ))
263+
264+ (ert-deftest haskell-indentation-check-18e ()
265+ " do and if then else indentation: else"
266+ :expected-result :failed
267+ (haskell-indentation-check
268+ " x = do"
269+ " if flag"
270+ " then do"
271+ " return ()"
272+ " ^" ))
273+
274+ (ert-deftest haskell-indentation-check-18f ()
275+ " do and if then else indentation: else"
276+ :expected-result :failed
277+ (haskell-indentation-check
278+ " x = do"
279+ " if flag"
280+ " then do"
281+ " return ()"
282+ " else do"
283+ " return ()"
284+ " ^" ))
285+
286+ (ert-deftest haskell-indentation-check-19a ()
287+ " let and in"
288+ (haskell-indentation-check
289+ " x = let"
290+ " y"
291+ " ^" ))
292+
293+ (ert-deftest haskell-indentation-check-19b ()
294+ " let and in"
295+ (haskell-indentation-check
296+ " x = let y"
297+ " in "
298+ " z "
299+ " ^" ))
300+
301+ (ert-deftest haskell-indentation-check-19c ()
302+ " let in a do"
303+ (haskell-indentation-check
304+ " x = do"
305+ " thing"
306+ " let "
307+ " z = 5"
308+ " ^" ))
309+
310+ (ert-deftest haskell-indentation-check-instance-20a ()
311+ " instance declaration"
312+ (haskell-indentation-check
313+ " instance C a where"
314+ " c = undefined"
315+ " ^" ))
316+
317+ (ert-deftest haskell-indentation-check-instance-20b ()
318+ " instance declaration"
319+ (haskell-indentation-check
320+ " instance (Monad m) => C m a where"
321+ " c = undefined"
322+ " ^" ))
0 commit comments