Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Integration: #6035 move the new tests above existing tests' doc comments

aiongg0c36fbc49d09
diff --git a/crates/engine/src/image_cmds.rs b/crates/engine/src/image_cmds.rs
index 5f37a2eaa..69fb1b17c 100644
--- a/crates/engine/src/image_cmds.rs
+++ b/crates/engine/src/image_cmds.rs
@@ -944,11 +944,7 @@ mod tests {
}
}
- /// The canvas border stays opaque after Image Size (it used to fade into transparency, so a
- /// Background or a 200 % export got a translucent frame), and a full selection stays full.
- /// #1544: 64 x 48 to 300000 x 300000 (90 billion pixels) started allocating resampled bands
- /// without a budget. It is refused before any allocation and the document is untouched; a
- /// change of resolution only, and an ordinary resize, still work.
+ /// #6019: Image Size on an Indexed Color document makes no colours the colour table doesn't have.
#[test]
fn image_size_resamples_indexed_color_with_nearest_neighbor() {
let mut s = Session::new();
@@ -970,6 +966,11 @@ mod tests {
}
}
+ /// The canvas border stays opaque after Image Size (it used to fade into transparency, so a
+ /// Background or a 200 % export got a translucent frame), and a full selection stays full.
+ /// #1544: 64 x 48 to 300000 x 300000 (90 billion pixels) started allocating resampled bands
+ /// without a budget. It is refused before any allocation and the document is untouched; a
+ /// change of resolution only, and an ordinary resize, still work.
#[test]
fn image_size_refuses_a_raster_past_the_budget() {
let mut s = Session::new();
diff --git a/crates/ui-egui/src/sizing.rs b/crates/ui-egui/src/sizing.rs
index c3ec7a199..d0e0cfdec 100644
--- a/crates/ui-egui/src/sizing.rs
+++ b/crates/ui-egui/src/sizing.rs
@@ -525,8 +525,7 @@ mod tests {
assert!(app.ui.dialogs.iter().any(|x| x.id == id), "reset leaves the dialog open");
}
- /// The dialog starts on Preferences › General › Image Interpolation: Bicubic Automatic opens
- /// as Automatic and the others as themselves (Bicubic Sharper used to open as Lanczos).
+ /// #6019: on an Indexed Color document the dialog opens on, and offers only, Automatic and Nearest Neighbor.
#[test]
fn indexed_color_resamples_with_nearest_neighbor_only() {
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());
@@ -555,6 +554,8 @@ mod tests {
}
}
+ /// The dialog starts on Preferences › General › Image Interpolation: Bicubic Automatic opens
+ /// as Automatic and the others as themselves (Bicubic Sharper used to open as Lanczos).
#[test]
fn resample_follows_the_interpolation_preference() {
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());