// SPDX-License-Identifier: LGPL-2.1-only
// Copyright (C) 2026 Liberux Labs, S. L. <info@liberux.net>

use super::*;

#[ test ]
fn value_clamped_on_creation()
{
	let p = progress_bar( 1.5 );
	assert_eq!( p.value, 1.0 );
	let p = progress_bar( -0.5 );
	assert_eq!( p.value, 0.0 );
}

#[ test ]
fn preferred_width_fills_available()
{
	let p = progress_bar( 0.5 );
	let ( w, _ ) = p.preferred_size( 300.0, &crate::render::Canvas::new( 400, 800 ) );
	assert_eq!( w, 300.0 );
}
