       def a, do: A1.no_func
       def b, do: A1.init
     end
-    """, """
+    """
+
+    warning = """
     warning: function A1.no_func/0 is undefined or private
       lib/a.ex:10
 
     """
+
+    assert_warnings(code, warning)
   end
 
   test "warnings: groups multiple warnings in one file" do
-    assert_warnings """
+    code = """
     defmodule A do
       def a, do: A.no_func
       def b, do: A2.no_func
       def c, do: A.no_func
       def d, do: A2.no_func
     end
-    """, """
+    """
+
+    warning = """
     warning: function A.no_func/0 is undefined or private
     Found at 2 locations:
       lib/a.ex:2

      lib/a.ex:3

    """
  end

  test "warnings: handles multiple modules in one file" do
    assert_warnings """
    defmodule A1 do
      def a, do: A2.no_func
      def b, do: A2.a

      File.write!("lib/a.ex", contents_a)
      File.write!("lib/b.ex", contents_b)

      output =
        capture_io(fn ->
          assert Mix.Task.run("xref", ["callers", callee]) == :ok
        end)

      assert output == expected
    end
  end

  ## Graph

  test "graph: basic usage" do
    assert_graph("""
    lib/a.ex
    └── lib/b.ex
        └── lib/a.ex
