       iex> 1 + 2
     3
   '''
-  def not_enough, do: :ok
+  def test_fun, do: :ok
 end |> write_beam
 
 defmodule ExUnit.DocTestTest.Incomplete do

  """

  @doc """
  iex> test_fun
  1
  iex> test_fun + 1
  2
  """
  def test_fun, do: 1

  @doc """
  iex> test_fun
  1
  iex> test_fun + 1
  1
  """
  def test_fun1, do: 1
end |> write_beam

defmodule ExUnit.DocTestTest.NoImport do


  test "fails on invalid use" do
    assert_raise RuntimeError, ~r"cannot define test", fn ->
      defmodule FunctionClashFail do
        import ExUnit.DocTest
        doctest ExUnit.DocTestTest.Invalid
      end
