/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * ---------------------------------------------------------------------
 *
 * Portions of this file were modified and ported to Vala by Victor Vintorez in 2026.
 * These modifications are licensed under the European Union Public License (EUPL),
 * Version 1.2 or later. You may obtain a copy of the License at:
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 */

using GLib;
using MaterialColorUtilities;

public class StringUtilsTest : McuTestCase {
	public StringUtilsTest () {
		base ("string_utils");
		add_test ("hex_from_argb", test_hex_from_argb);
	}

	public override void set_up () {}

	public void test_hex_from_argb () {
		var result_0 = StringUtils.hex_from_argb ((int) 914181854);
		var result_1 = StringUtils.hex_from_argb ((int) 1941786595);
		var result_2 = StringUtils.hex_from_argb ((int) 4002780905);
		var result_3 = StringUtils.hex_from_argb ((int) 2734560664);
		var result_4 = StringUtils.hex_from_argb ((int) 3291681504);
		var result_5 = StringUtils.hex_from_argb ((int) 607316496);
		var result_6 = StringUtils.hex_from_argb ((int) 2460285668);
		var result_7 = StringUtils.hex_from_argb ((int) 3285071752);
		var result_8 = StringUtils.hex_from_argb ((int) 3940857847);
		var result_9 = StringUtils.hex_from_argb ((int) 1802349691);

		assert (result_0 == "#7d4ede");
		assert (result_1 == "#bd4fe3");
		assert (result_2 == "#9596e9");
		assert (result_3 == "#fe1598");
		assert (result_4 == "#3312e0");
		assert (result_5 == "#32ea10");
		assert (result_6 == "#a4fae4");
		assert (result_7 == "#ce3788");
		assert (result_8 == "#e4b7f7");
		assert (result_9 == "#6dac7b");
	}

	public override void tear_down () {}
}
