     assert expand('IEx.AutocompleteTest.SublevelTest.') == {:yes, 'LevelA', []}
   end
 
-  @tag previous_line: "alias List, as: MyList"
   test "complete aliases of Elixir modules" do
+    eval("alias List, as: MyList")
     assert expand('MyL') == {:yes, 'ist', []}
     assert expand('MyList') == {:yes, '.', []}
     assert expand('MyList.to_integer') == {:yes, [], ['to_integer/1', 'to_integer/2']}
   end
 
-  @tag previous_line: "alias :lists, as: EList"
   test "complete aliases of Erlang modules" do
+    eval("alias :lists, as: EList")
     assert expand('EL') == {:yes, 'ist', []}
     assert expand('EList') == {:yes, '.', []}
     assert expand('EList.map') == {:yes, [], ['map/2', 'mapfoldl/3', 'mapfoldr/3']}

defmodule IEx.AutocompleteTest do
  use ExUnit.Case, async: true

  setup context do
    ExUnit.CaptureIO.capture_io(fn ->
      evaluator = IEx.Server.start_evaluator([])
      Process.put(:evaluator, evaluator)

      previous_line = context[:previous_line]
      if previous_line do
        send evaluator, {:eval, self(), previous_line <> "\n", %IEx.State{}}
        assert_receive {:evaled, _, _}
      end
    end)

    :ok
  end


    assert expand('String.printable?/') == {:yes, '', ['printable?/1']}
  end

  test "function completion using a variable bound to a module" do
    eval("mod = String")
    assert expand('mod.print') == {:yes, 'able?', []}
  end

  test "map atom key completion is supported" do
    eval("map = %{foo: 1, bar_1: 23, bar_2: 14}")
    assert expand('map.f') == {:yes, 'oo', []}
    assert expand('map.b') == {:yes, 'ar_', []}
    assert expand('map.bar_') == {:yes, '', ['bar_1', 'bar_2']}
