Skip to content

Commit

Permalink
add test ensuring all nodes have line meta
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed Dec 8, 2023
1 parent 2c0d186 commit c01f2e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/support/style_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ defmodule Styler.StyleCase do
IO.puts("========================\n")
end

styled_ast
|> Styler.Zipper.zip()
|> Styler.Zipper.traverse(fn {
{_, meta, _} = node, _} = zipper ->
assert meta[:line], "missing `:line` meta in \nnode:\n#{inspect node} \ntree:\n#{inspect styled_ast}"
zipper
zipper ->
zipper
end)

assert expected == styled
{_, restyled, _} = style(styled)

Expand Down

0 comments on commit c01f2e1

Please sign in to comment.