       "nofile:2: tried to invoke macro Kernel.ErrorsTest.UnproperMacro.unproper/1 " <>
       "but module was not required. Required: Kernel, Kernel.Typespec, Record",
       '''
-      defmodule Foo do
+      defmodule ErrorsTest do
         Kernel.ErrorsTest.UnproperMacro.unproper([])
       end
       '''

    assert_compile_fail CompileError,
      "nofile:2: function bar/0 undefined",
      '''
      defmodule Foo do
        def foo, do: bar
      end
      '''

    assert_compile_fail CompileError,
      "nofile:3: defmacro foo/1 already defined as def",
      '''
      defmodule ErrorsTest do
        def foo(1), do: 1
        defmacro foo(x), do: x
      end
