test "Sell 0 ships"
	# Known failure, see https://github.com/endless-sky/endless-sky/issues/6628
	status "known failure"
	description "Test departing without sell a ship."
	sequence
		# Create/inject the savegame and load it.
		inject "Fighters and Carriers and Escorts"
		call "Load First Savegame"
		call "Depart"
		# We can only check the conditions after departing, since the conditions are not updated directly after loading or selling.
		apply
			"test: ships: Fighter" = "ships: Fighter"
			"test: ships: Heavy Warship" = "ships: Heavy Warship"
			"test: ships: ships: Medium Warship" = "ships: Medium Warship"
		assert
			and
				"ships: Fighter" == 2
				"ships: Heavy Warship" == 1
				"ships: Medium Warship" == 1


test "Sell 1 ship"
	status active
	description "Test selling a single ship."
	sequence
		# Create/inject the savegame and load it.
		inject "Fighters and Carriers and Escorts"
		call "Load First Savegame"
		call "Sell first ship"
		call "Depart"
		# We can only check the conditions after departing, since the conditions are not updated directly after loading or selling.
		assert
			and
				"ships: Fighter" == 1
				"ships: Heavy Warship" == 1
				"ships: Medium Warship" == 1
				"flagship model: Finch" == 1
				"flagship model: Bactrian" == 0


test "Sell 2 ships"
	status active
	description "Test selling two ships."
	sequence
		# Create/inject the savegame and load it.
		inject "Fighters and Carriers and Escorts"
		call "Load First Savegame"
		call "Sell first ship"
		call "Sell first ship"
		call "Depart"
		# We can only check the conditions after departing, since the conditions are not updated directly after loading or selling.
		assert
			and
				"ships: Fighter" == 0
				"ships: Heavy Warship" == 1
				"ships: Medium Warship" == 1
				"flagship model: Bactrian" == 1
				"flagship model: Finch" == 0


test "Sell 3 ships"
	status active
	description "Test selling three ships."
	sequence
		# Create/inject the savegame and load it.
		inject "Fighters and Carriers and Escorts"
		call "Load First Savegame"
		call "Sell first ship"
		call "Sell first ship"
		call "Sell first ship"
		call "Depart"
		# We can only check the conditions after departing, since the conditions are not updated directly after loading or selling.
		assert
			and
				"ships: Fighter" == 0
				"ships: Heavy Warship" == 0
				"ships: Medium Warship" == 1
				"flagship model: Aerie" == 1
				"flagship model: Finch" == 0
				"flagship model: Bactrian" == 0
