<commit_before>defmodule Credo.Check.Warning.NameRedeclarationByCaseTest do
  use Credo.TestHelper

  @described_check Credo.Check.Warning.NameRedeclarationByCase

  test "it should NOT report expected code" do
"""
defmodule CredoSampleModule do
  use ExUnit.Case

  def fun1 do
    case fun2 do
      x -> x
      %{something: foobar} -> foobar
    end
  end

  defmacro fun2 do
    42
  end
end
""" |> to_source_file
    |> refute_issues(@described_check)<commit_msg>Add failing test to reproduce #9<commit_after>defmodule Credo.Check.Warning.NameRedeclarationByCaseTest do
  use Credo.TestHelper

  @described_check Credo.Check.Warning.NameRedeclarationByCase

  test "it should NOT report expected code" do
"""
defmodule CredoSampleModule do
  use ExUnit.Case

  def fun1 do
    case fun2 do
      x -> x
      %{something: foobar} -> foobar
      ~r/@/ -> something
    end
  end

  defmacro fun2 do
    42
  end
end
""" |> to_source_file
    |> refute_issues(@described_check)
{'fraction_non_alphanumeric': 0.07841140529531568, 'fraction_numerical': 0.01120162932790224, 'mean_word_length': 3.349557522123894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6200878', 'n_tokens_mistral': 354, 'n_tokens_neox': 317, 'n_words': 88}