       lib/a.ex:5
 
     """
+
+    assert_warnings(code, warning)
   end
 
   test "warnings: handles module body conditionals" do
-    assert_warnings """
+    code = """
     defmodule A do
       if function_exported?(List, :flatten, 1) do
         List.flatten([1, 2, 3])

      def b(a), do: parse(a)
      _ = is_even(Enum.random([1])); def c(a), do: is_even(a)
    end
    """, """
    lib/a.ex:4: Integer.is_even/1
    lib/a.ex:7: Integer.is_even/1
    lib/a.ex:10: Integer.is_even/1

      lib/a.ex:15

    """

    assert_warnings(code, warning)
  end

  test "warnings: imports" do
    assert_no_warnings("""
    defmodule A do
      import Record

      def a(a, b), do: extract(a, b)
      def b(arg), do: is_record(arg)
    end
    """)
  end

  test "warnings: aliases" do
    code = """
    defmodule A do
      alias Enum, as: E

      def a(a, b), do: E.map2(a, b)
      def b, do: &E.map2/2
    end
    """

    warning = """
    warning: function Enum.map2/2 is undefined or private. Did you mean one of:

          * map/2
