       fn
         _, nil, next ->
           next.(:oops)
+
         :get, data, next ->
           next.(Enum.at(data, index))
+
         :get_and_update, data, next ->
           current = Enum.at(data, index)
+
           case next.(current) do
             {get, update} -> {get, List.replace_at(data, index, update)}
             :pop -> {current, List.delete_at(data, index)}

  defp empty_list(), do: []

  test "=~/2" do
    assert ("abcd" =~ ~r/c(d)/) == true
    assert ("abcd" =~ ~r/e/) == false
    assert ("abcd" =~ ~R/c(d)/) == true
    assert ("abcd" =~ ~R/e/) == false

    string = "^ab+cd*$"
    assert (string =~ "ab+") == true
    assert (string =~ "bb") == false

    assert ("abcd" =~ ~r//) == true
    assert ("abcd" =~ ~R//) == true
    assert ("abcd" =~ "") == true

    assert ("" =~ ~r//) == true
    assert ("" =~ ~R//) == true
    assert ("" =~ "") == true

    assert ("" =~ "abcd") == false
    assert ("" =~ ~r/abcd/) == false
    assert ("" =~ ~R/abcd/) == false

    assert_raise FunctionClauseError, "no function clause matching in Kernel.=~/2", fn ->
      1234 =~ "hello"

    defp expand_to_string(ast) do
      ast
      |> Macro.prewalk(&Macro.expand(&1, __ENV__))
      |> Macro.to_string()
    end

    defp assert_eval_raise(error, msg, string) do
