local map = ...
local game = map:get_game()

function map:on_opening_transition_finished()

  -- Picking up a regenerating destructible must not call on_cut().
  local cut_called = false
  function destructible_regen:on_cut()
    cut_called = true
  end

  game:simulate_command_pressed("action")

  sol.timer.start(map, 1000, function()
    assert_equal(hero:get_state(), "carrying")
    assert(destructible_regen ~= nil, "regenerating destructible should remain on the map after pickup")
    assert(not cut_called, "on_cut() must not be called when picking up a regenerating destructible")
    sol.main.exit()
  end)
end
