use azul_layout::solver3::sizing::*;
#[test]
fn test_resolve_percentage_with_box_model_basic() {
let result = resolve_percentage_with_box_model(
595.0,
1.0, (0.0, 0.0),
(0.0, 0.0),
(0.0, 0.0),
);
assert_eq!(result, 595.0);
}
#[test]
fn test_resolve_percentage_with_box_model_with_margins() {
let result = resolve_percentage_with_box_model(
595.0,
1.0, (20.0, 20.0),
(0.0, 0.0),
(0.0, 0.0),
);
assert_eq!(result, 595.0);
}
#[test]
fn test_resolve_percentage_with_box_model_with_all_box_properties() {
let result = resolve_percentage_with_box_model(
500.0,
1.0, (10.0, 10.0),
(5.0, 5.0),
(8.0, 8.0),
);
assert_eq!(result, 500.0);
}
#[test]
fn test_resolve_percentage_with_box_model_50_percent() {
let result = resolve_percentage_with_box_model(
600.0,
0.5, (20.0, 20.0),
(0.0, 0.0),
(0.0, 0.0),
);
assert_eq!(result, 300.0);
}
#[test]
fn test_resolve_percentage_with_box_model_asymmetric() {
let result = resolve_percentage_with_box_model(
1000.0,
1.0,
(100.0, 50.0),
(10.0, 20.0),
(5.0, 15.0),
);
assert_eq!(result, 1000.0);
}
#[test]
fn test_resolve_percentage_with_box_model_negative_clamping() {
let result = resolve_percentage_with_box_model(
100.0,
1.0,
(60.0, 60.0), (0.0, 0.0),
(0.0, 0.0),
);
assert_eq!(result, 100.0);
}
#[test]
fn test_resolve_percentage_with_box_model_zero_percent() {
let result = resolve_percentage_with_box_model(
1000.0,
0.0, (100.0, 100.0),
(10.0, 10.0),
(5.0, 5.0),
);
assert_eq!(result, 0.0);
}