Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusmuller committed Sep 23, 2023
1 parent 138d2d5 commit 1ef2799
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/credo/check/readability/duplicated_aliases_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,32 @@ defmodule Credo.Check.Readability.DuplicatedAliasesTest do
|> run_check(@described_check)
|> assert_issue()
end

test "should NOT raise an issue for single line alias + duplicated multi-alias" do
file = """
defmodule M1 do
alias IO.ANSI
alias {IO.ANSI, URI}
end
"""

file
|> to_source_file
|> run_check(@described_check)
|> refute_issues()
end

test "should NOT raise an issue for duplicated alias between multi-aliases" do
file = """
defmodule M1 do
alias {IO.ANSI, URI}
alias {File, IO.ANSI}
end
"""

file
|> to_source_file
|> run_check(@described_check)
|> refute_issues()
end
end

0 comments on commit 1ef2799

Please sign in to comment.