// Copyright 2025 Gabriel Bjørnager Jensen.

#![cfg(test)]

use multitype::UintLeast32;

#[test]
fn test_least() {
	fn op<T: UintLeast32>(mut value: T) -> T {
		value /= T::from_u8(0x2);

		value
	}

	let mut value0 = u32::MAX;
	let mut value1 = u64::MAX;
	let mut value2 = u128::MAX;

	value0 = op(value0);
	value1 = op(value1);
	value2 = op(value2);

	assert_eq!(value0, 0x7FFF_FFFF);
	assert_eq!(value1, 0x7FFF_FFFF_FFFF_FFFF);
	assert_eq!(value2, 0x7FFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF);
}
