Skip to content

Commit 2ce39df

Browse files
committed
added failing tests for named functions in if and case
1 parent 689510d commit 2ce39df

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test/elixir-mode-indentation-test.el

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,29 @@ else: :bar"
376376
else: :bar"
377377
)
378378

379+
(elixir-def-indentation-test indent-if-when-condition-is-a-named-function-on-a-module
380+
(:expected-result :failed :tags '(indentation))
381+
;; https://github.com/elixir-lang/emacs-elixir/issues/323
382+
"defmodule Whois do
383+
def lookup2(domain) do
384+
if Server.for(domain) do
385+
:ok
386+
else
387+
:error
388+
end
389+
end
390+
end"
391+
"defmodule Whois do
392+
def lookup2(domain) do
393+
if Server.for(domain) do
394+
:ok
395+
else
396+
:error
397+
end
398+
end
399+
end"
400+
)
401+
379402
(elixir-def-indentation-test indent-try
380403
(:tags '(indentation))
381404
"
@@ -1525,6 +1548,27 @@ end"
15251548
end
15261549
end")
15271550

1551+
(elixir-def-indentation-test indent-case-when-condition-is-a-named-function-on-a-module
1552+
(:expected-result :failed :tags '(indentation))
1553+
;; https://github.com/elixir-lang/emacs-elixir/issues/323
1554+
"defmodule Whois do
1555+
def lookup1(domain) do
1556+
case Server.for(domain) do
1557+
{:ok, server} -> server
1558+
:error -> {:error, :unsupported}
1559+
end
1560+
end
1561+
end"
1562+
"defmodule Whois do
1563+
def lookup1(domain) do
1564+
case Server.for(domain) do
1565+
{:ok, server} -> server
1566+
:error -> {:error, :unsupported}
1567+
end
1568+
end
1569+
end"
1570+
)
1571+
15281572
(elixir-def-indentation-test close-map-curly-brackt
15291573
(:tags '(indentation))
15301574
"

0 commit comments

Comments
 (0)