Skip to content

Commit f2cb58b

Browse files
committed
More tests
1 parent 0bd0520 commit f2cb58b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/elixir/test/elixir/inspect/algebra_test.exs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@ defmodule Inspect.AlgebraTest do
204204
assert render(group(doc), 5) == "hello\na\nb\ncd"
205205
end
206206

207+
test "group modes doc" do
208+
doc = glue(glue("hello", "a"), "b")
209+
assert render(doc, 10) == "hello a b"
210+
211+
assert render(doc |> glue("c") |> group(), 10) ==
212+
"hello\na\nb\nc"
213+
214+
assert render(doc |> group(:optimistic) |> glue("c") |> group() |> glue("d"), 10) ==
215+
"hello\na\nb c d"
216+
217+
assert render(doc |> group(:optimistic) |> glue("c") |> group(:pessimistic) |> glue("d"), 10) ==
218+
"hello\na\nb c\nd"
219+
end
220+
207221
test "no limit doc" do
208222
doc = no_limit(group(glue(glue("hello", "a"), "b")))
209223
assert render(doc, 5) == "hello a b"

0 commit comments

Comments
 (0)