Skip to content

Commit 5383308

Browse files
committed
Merge pull request #324 from gausby/failing-indentation-tests-for-named-functions-in-if-and-case
added failing tests for named functions in if and case
2 parents 7b32644 + 2ce39df commit 5383308

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
"
@@ -1551,6 +1574,27 @@ end"
15511574
end
15521575
end")
15531576

1577+
(elixir-def-indentation-test indent-case-when-condition-is-a-named-function-on-a-module
1578+
(:expected-result :failed :tags '(indentation))
1579+
;; https://github.com/elixir-lang/emacs-elixir/issues/323
1580+
"defmodule Whois do
1581+
def lookup1(domain) do
1582+
case Server.for(domain) do
1583+
{:ok, server} -> server
1584+
:error -> {:error, :unsupported}
1585+
end
1586+
end
1587+
end"
1588+
"defmodule Whois do
1589+
def lookup1(domain) do
1590+
case Server.for(domain) do
1591+
{:ok, server} -> server
1592+
:error -> {:error, :unsupported}
1593+
end
1594+
end
1595+
end"
1596+
)
1597+
15541598
(elixir-def-indentation-test close-map-curly-brackt
15551599
(:tags '(indentation))
15561600
"

0 commit comments

Comments
 (0)