diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index 89cc212be..85e11508c 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -58,6 +58,15 @@ Example of lines: " z" "^ ^ ^")) +(ert-deftest haskell-indentation-check-2-unicode () + :expected-result :failed + "Handle underscore in identifiers (unicode)" + (haskell-indentation-check + "function = do" + " (_x) ← return ()" + " z" + "^ ^ ^")) + (ert-deftest haskell-indentation-check-2a () "Handle apostrophe in identifiers" (haskell-indentation-check @@ -66,6 +75,14 @@ Example of lines: " z" "^ ^ ^")) +(ert-deftest haskell-indentation-check-2a-unicode () + "Handle apostrophe in identifiers (unicode)" + :expected-result :failed + (haskell-indentation-check + "function = do" + " (_'x') ← return ()" + " z" + "^ ^ ^")) (ert-deftest haskell-indentation-check-3 () "Import statememnt symbol list 1" @@ -108,6 +125,16 @@ Example of lines: " , f <- fx x y c ]" " ^")) +(ert-deftest haskell-indentation-check-6-unicode () + "let in list comprehension (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun = [ f | x ← xs" + " , y ← ys" + " , let c = 123" + " , f ← fx x y c ]" + " ^")) + (ert-deftest haskell-indentation-check-7 () "import after import" :expected-result :failed @@ -147,6 +174,15 @@ Example of lines: " , Just val2 <- lookup env var2" " ^")) +(ert-deftest haskell-indentation-check-11-unicode () + :expected-result :failed + "Guards with commas (unicode)" + (haskell-indentation-check + "clunky env var1 var2" + " | Just val1 ← lookup env var1" + " , Just val2 ← lookup env var2" + " ^")) + (ert-deftest haskell-indentation-check-12 () "Guards with commas" :expected-result :failed @@ -189,6 +225,13 @@ Example of lines: "fun = \x -> do" " ^")) +(ert-deftest haskell-indentation-check-16-unicode () + "Lambda and a do block (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun = \x → do" + " ^")) + (ert-deftest haskell-indentation-check-16a () "A lambda" :expected-result :failed @@ -196,6 +239,13 @@ Example of lines: "fun = \x ->" " ^")) +(ert-deftest haskell-indentation-check-16a-unicode () + "A lambda (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun = \x →" + " ^")) + (ert-deftest haskell-indentation-check-17a () "A type for a function" :expected-result :failed @@ -212,6 +262,14 @@ Example of lines: " => Int" " ^")) +(ert-deftest haskell-indentation-check-17b-unicode () + "A type for a function with context (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun ∷ Monad m" + " ⇒ Int" + " ^")) + (ert-deftest haskell-indentation-check-17c () "A type for a function with complicated context" :expected-result :failed @@ -220,6 +278,14 @@ Example of lines: " => MyMonad (A v) m" " ^")) +(ert-deftest haskell-indentation-check-17c-unicode () + "A type for a function with complicated context (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun ∷ (Monad m, MonadBaseControl IO m, MyMonad (A v) m)" + " ⇒ MyMonad (A v) m" + " ^")) + (ert-deftest haskell-indentation-check-17d () "A type for a function with param and a complicated context" :expected-result :failed @@ -229,6 +295,15 @@ Example of lines: " -> m (Maybe a)" " ^")) +(ert-deftest haskell-indentation-check-17d-unicode () + "A type for a function with param and a complicated context (unicode)" + :expected-result :failed + (haskell-indentation-check + "fun ∷ (Monad m, MonadBaseControl IO m, MyMonad (A v) m)" + " ⇒ MyMonad (A v) m" + " → m (Maybe a)" + " ^")) + (ert-deftest haskell-indentation-check-18a () "if then else indentation: then" (haskell-indentation-check @@ -321,6 +396,13 @@ Example of lines: " c = undefined" " ^")) +(ert-deftest haskell-indentation-check-instance-20b-unicode () + "instance declaration (unicode)" + (haskell-indentation-check + "instance (Monad m) ⇒ C m a where" + " c = undefined" + " ^")) + (ert-deftest haskell-indentation-check-instance-21a () "layout versus comma in braces" (haskell-indentation-check @@ -330,3 +412,13 @@ Example of lines: " bar = 0" " , baz = 0" " ^")) + +(ert-deftest haskell-indentation-check-instance-21a-unicode () + "layout versus comma in braces (unicode)" + (haskell-indentation-check + "main ∷ IO ()" + "main = do" + "let foo = Foo {" + " bar = 0" + " , baz = 0" + " ^"))