From 50d485ce768dad8bc55d228dc2433489fc8a044a Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Thu, 5 Nov 2026 13:05:38 +0100 Subject: [PATCH] test(engine): pin the #6958 exposure fixtures in File Info camera data (#6983) Main fixed the exposure formatting itself in be9f0c250, so what is left here is the regression coverage the report asked for, asserted through a real EXIF block: the two reported values (0.031714 s -> 1/32 s, 0.0215 s -> 1/47 s), a reciprocal that rounds to a whole denominator (1/3 s), and the three-significant-digit decimal fallback for a time too far from any whole denominator (0.2731 s -> 0.273 s). Fixes #6958 Co-authored-by: highperfocused --- crates/engine/src/cmd/file_cmds/tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/engine/src/cmd/file_cmds/tests.rs b/crates/engine/src/cmd/file_cmds/tests.rs index 804e6a01ca..4e2ff3bf9c 100644 --- a/crates/engine/src/cmd/file_cmds/tests.rs +++ b/crates/engine/src/cmd/file_cmds/tests.rs @@ -1300,6 +1300,12 @@ fn camera_data_formats_like_photoshop_and_falls_back_to_xmp() { assert_eq!(info(Some(0.5), Some(5.6), None), json!({"exposure": "1/2 s", "fNumber": "f/5.6"})); assert_eq!(info(Some(0.4), None, None), json!({"exposure": "0.4 s"})); assert_eq!(info(Some(1.0 / 2000.0), None, None), json!({"exposure": "1/2000 s"})); + // Non-standard fractions round to the nearest 1/n instead of losing digits (#6958). + assert_eq!(info(Some(0.031714), None, None), json!({"exposure": "1/32 s"})); + assert_eq!(info(Some(0.0215), None, None), json!({"exposure": "1/47 s"})); + assert_eq!(info(Some(1.0 / 3.0), None, None), json!({"exposure": "1/3 s"})); + // Too far from any whole denominator: three significant digits, not two decimals. + assert_eq!(info(Some(0.2731), None, None), json!({"exposure": "0.273 s"})); assert_eq!(info(Some(0.0), Some(0.0), Some(0.0)), json!({})); // No EXIF block (a raw import, XMP-only files): Photoshop's exif:/tiff:/aux: properties. let xmp = r#"