// Copyright 2025 Gabriel Bjørnager Jensen.

#![cfg(test)]

use crate::{Least32, Uint};

#[test]
fn test_least() {
	let mut value0 = 0x0u32;
	let mut value1 = 0x0u64;
	let mut value2 = 0x0u128;

	fn op<T: Least32 + Uint>(value: &mut T) {
		*value = T::from_u32(u32::MAX - 0x1);
	}

	op(&mut value0);
	op(&mut value1);
	op(&mut value2);

	assert_eq!(value0, 0xFFFFFFFE);
	assert_eq!(value1, 0xFFFFFFFE);
	assert_eq!(value2, 0xFFFFFFFE);
}
