summaryrefslogtreecommitdiff
path: root/lib/elixir/test/elixir/code_formatter
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2017-10-25 18:53:17 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2017-10-25 19:36:34 +0200
commitf09657180fc28412b88e8877d30efbe0d9a84233 (patch)
treecad35568568aed7ec59e728bdbd42a2eba8c0a40 /lib/elixir/test/elixir/code_formatter
parent58a973ae12bb2485cc813ea1c4d57f04a48e3c51 (diff)
downloadelixir-f09657180fc28412b88e8877d30efbe0d9a84233.tar.gz
Support next break fits inside tuples
This only applies if the tuple has not been "spaced out".
Diffstat (limited to 'lib/elixir/test/elixir/code_formatter')
-rw-r--r--lib/elixir/test/elixir/code_formatter/integration_test.exs34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/elixir/test/elixir/code_formatter/integration_test.exs b/lib/elixir/test/elixir/code_formatter/integration_test.exs
index 645a96695..55ee9ee17 100644
--- a/lib/elixir/test/elixir/code_formatter/integration_test.exs
+++ b/lib/elixir/test/elixir/code_formatter/integration_test.exs
@@ -343,4 +343,38 @@ defmodule Code.Formatter.IntegrationTest do
fn 1 -> "hello" end
"""
end
+
+ test "tuples as trees" do
+ bad = """
+ @document Parser.parse(
+ {"html", [], [
+ {"head", [], []},
+ {"body", [], [
+ {"div", [], [
+ {"p", [], ["1"]},
+ {"p", [], ["2"]},
+ {"div", [], [
+ {"p", [], ["3"]},
+ {"p", [], ["4"]}]},
+ {"p", [], ["5"]}]}]}]})
+ """
+
+ good = """
+ @document Parser.parse(
+ {"html", [], [
+ {"head", [], []},
+ {"body", [], [
+ {"div", [], [
+ {"p", [], ["1"]},
+ {"p", [], ["2"]},
+ {"div", [], [{"p", [], ["3"]}, {"p", [], ["4"]}]},
+ {"p", [], ["5"]}
+ ]}
+ ]}
+ ]}
+ )
+ """
+
+ assert_format bad, good
+ end
end