Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
quangngd committed Jan 31, 2025
1 parent 5936333 commit 3e54945
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/credo/check/consistency/unused_variable_names_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,18 @@ defmodule Credo.Check.Consistency.UnusedVariableNamesTest do
end)
end)
end

test "it should report a violation once" do

Check failure on line 393 in test/credo/check/consistency/unused_variable_names_test.exs

View workflow job for this annotation

GitHub Actions / Test for lib/ changes

test it should report a violation once (Credo.Check.Consistency.UnusedVariableNamesTest)
[
"""
defmodule Foo do
def bar(["a" <> _a] = assigns), do: :ok
def baz(["a" <> _] = assigns), do: :ok
end
"""
]
|> to_source_files
|> run_check(@described_check)
|> assert_issue()
end
end

0 comments on commit 3e54945

Please sign in to comment.