   end
 
   test "function definition with alias" do
-    assert_compile_fail CompileError,
+    assert_eval_raise CompileError,
       "nofile:2: function names should start with lowercase characters or underscore, invalid name Bar",
       '''
       defmodule Kernel.ErrorsTest.FunctionDefinitionWithAlias do

  end

  test "internal function overridden" do
    assert_compile_fail CompileError,
      "nofile:2: cannot define def __info__/1 as it is automatically defined by Elixir",
      '''
      defmodule Kernel.ErrorsTest.InternalFunctionOverridden do

      end
      '''

    assert_eval_raise CompileError,
      "nofile:3: def hello/2 conflicts with defaults from def hello/3",
      ~C'''
      defmodule Kernel.ErrorsTest.DifferentDefsWithDefaults2 do
