#3466: test Sharpen Amount clamps just outside 0..4000

prop.set of 4001 and -1 stores 4000 and 0, and undo/redo around the
clamped set restore the values.
This commit is contained in:
arnav-hiwarkar
2026-11-17 16:14:33 +05:30
parent 6c5d0b51ec
commit 300fc48f1e
+17
View File
@@ -162,6 +162,23 @@ fn projects_saved_with_the_narrower_ranges_open_with_the_new_ones() {
}
}
/// #3466: Sharpen Amount clamps just outside After Effects' 0..4000, and an undo after a
/// clamped set restores the value from before it.
#[test]
fn sharpen_amount_clamps_outside_the_after_effects_range() {
let (mut s, l, _) = session();
let (e, p) = ("ec.blur.sharpen", "amount");
for (v, want) in [(4001.0, 4000.0), (-1.0, 0.0)] {
set(&mut s, l, e, p, 1000.0);
assert_eq!(set(&mut s, l, e, p, v), json!(want), "{v}: prop.set reply");
assert_eq!(read(&mut s, l, e, p), want, "{v}");
assert!(s.undo());
assert_eq!(read(&mut s, l, e, p), 1000.0, "{v}: undo");
assert!(s.redo());
assert_eq!(read(&mut s, l, e, p), want, "{v}: redo");
}
}
/// The property at `path` (`group/param`) in an effect instance.
fn prop_mut<'a>(g: &'a mut PropGroup, path: &str) -> Option<&'a mut effectcraft_project::Property> {
match path.split_once('/') {