Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed Jun 22, 2023
1 parent 6c2b5c9 commit dd000bd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/style/module_directives_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,34 @@ defmodule Styler.Style.ModuleDirectivesTest do
""")
end
end

describe "with comments..." do
test "moving aliases up through non-directives doesn't move comments up" do
assert_style """
defmodule Foo do
alias B
# hi
# this is foo
def foo do
# i promise it's ok!
:ok
end
alias A
end
""",
"""
defmodule Foo do
@moduledoc false
alias A
alias B
# hi
# this is foo
def foo do
# i promise it's ok!
:ok
end
end
"""
end
end
end

0 comments on commit dd000bd

Please sign in to comment.