From 6318364ce7d7126ca53dfeadcfc9606b2cd5300a Mon Sep 17 00:00:00 2001 From: Haocheng Fang Date: Wed, 21 Oct 2026 13:16:29 -0500 Subject: [PATCH] #323: keep the default_is_automatic regression test The PR branch dropped it along with the PREVIEW_LIMITS import; nothing here changes the default preview limit. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests_preview_limit.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests_preview_limit.rs b/crates/ui-egui/src/tests_preview_limit.rs index c362c11c8..070921256 100644 --- a/crates/ui-egui/src/tests_preview_limit.rs +++ b/crates/ui-egui/src/tests_preview_limit.rs @@ -2,7 +2,7 @@ //! loupe renders at the size it is drawn at (up to the photo's own pixels and a safety ceiling); //! "Preview size" in Settings only lowers that when the user asks for it. -use crate::state::{AppSettings, LOUPE_EDGE_CEILING, STANDARD_PREVIEW_EDGE}; +use crate::state::{AppSettings, LOUPE_EDGE_CEILING, PREVIEW_LIMITS, STANDARD_PREVIEW_EDGE}; /// A texture side no GPU we run on refuses (see the tests of small ones below). const BIG: usize = 16384; @@ -11,6 +11,13 @@ fn with_limit(preview_limit: u32) -> AppSettings { AppSettings { preview_limit, ..Default::default() } } +// Given a fresh install +#[test] +fn default_is_automatic() { + assert_eq!(AppSettings::default().preview_limit, 0); + assert_eq!(PREVIEW_LIMITS[0], 0, "Automatic is the first choice"); +} + // Given Automatic, when a 24 MP photo is shown at 1:1, then the render is the photo's own width #[test] fn automatic_renders_a_one_to_one_view_at_native_size() {