diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2017-10-25 18:53:17 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2017-10-25 19:36:34 +0200 |
commit | f09657180fc28412b88e8877d30efbe0d9a84233 (patch) | |
tree | cad35568568aed7ec59e728bdbd42a2eba8c0a40 /lib/elixir/test/elixir/code_formatter | |
parent | 58a973ae12bb2485cc813ea1c4d57f04a48e3c51 (diff) | |
download | elixir-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.exs | 34 |
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 |