     in_fixture "no_mixfile", fn ->
       write_no_func()
 
-      assert_warn_no_func fn ->
+      assert_warn_no_func(fn ->
         assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
-        assert {:error, [%Mix.Task.Compiler.Diagnostic{
-          severity: :error
-        }]} = Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"])
-      end
+        assert {:error, [diagnostic]} = Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"])
+        assert %Mix.Task.Compiler.Diagnostic{severity: :error} = diagnostic
+      end)
     end
   end
 
   test "does not return error status if warnings-as-errors and no warnings" do
     in_fixture "no_mixfile", fn ->
-      assert_no_warn fn ->
+      assert_no_warn(fn ->
         assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
         assert Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"]) == {:noop, []}
-      end
+      end)
     end
   end
 


      [xref_manifest] = Mix.Tasks.Compile.Xref.manifests()

      assert_no_warn fn ->
        assert Mix.Tasks.Compile.Xref.run([]) == {:noop, []}
        refute File.exists? xref_manifest
      end
    end
  end


    in_fixture "no_mixfile", fn ->
      write_no_func()

      assert_warn_no_func(fn ->
        assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
        file = Path.absname("lib/a.ex")

        assert {:noop, [diagnostic]} = Mix.Tasks.Compile.Xref.run([])

        assert %Mix.Task.Compiler.Diagnostic{
                 compiler_name: "Xref",
                 file: ^file,
                 message: "function B.no_func/0 is undefined or private",
                 position: 2,
                 severity: :warning
               } = diagnostic
      end)

      [manifest] = Mix.Tasks.Compile.Elixir.manifests()
      future = {{2020, 1, 1}, {0, 0, 0}}
