# Copyright (c) 2022 by warp-core
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

test "Clear flagship model condition"
	status active
	description "Test that the flagship model condition is correctly cleared."
	sequence
		# Create/inject the savegame and load it.
		inject "Fighters and Carriers and Escorts Save"
		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.
		assert
			"flagship model: Finch" == 1
		# Landing clears the flagship's conditions.
		call "Land"
		call "Sell first ship"
		call "Depart"
		assert
			"flagship model: Finch" == 1
		call "Land"
		call "Sell first ship"
		call "Depart"
		assert
			and
				"flagship model: Bactrian" == 1
				"flagship model: Finch" == 0
		call "Land"
		call "Sell first ship"
		call "Depart"
		assert
			and
				"flagship model: Aerie" == 1
				"flagship model: Bactrian" == 0
				"flagship model: Finch" == 0
