diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index d511884a04..54241cf172 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -378,25 +378,6 @@ fn azerbaijani_keeps_context_placeholders_and_command_names() { assert!(fmt(tr(lang, "About {app}"), &[("app", "PhotoCraft")]).contains("PhotoCraft")); } -/// Every menu label, submenu segment and intentional command-ID override has a catalog entry. -#[test] -fn azerbaijani_covers_every_menu_label_and_path() { - let lang = Lang::from_code("az").expect("az registered"); - for &(path, label, _, _) in crate::menu_catalog::CATALOG { - for source in path.iter().copied().chain(std::iter::once(label)).filter(|source| *source != "---") { - assert!(lang.catalog().plain(source).is_some(), "az: missing menu translation for {source:?}"); - } - } - for source in ["Convert to Frame…", "Replace Image…", "Import Image…", "Fit Content to Frame", "Fit Frame to Content"] { - assert!(lang.catalog().plain(source).is_some(), "az: missing frame translation for {source:?}"); - } - for id in - ["edit.clear", "edit.purge.undo", "edit.stroke", "edit.transform.scale", "file.close", "filter.sharpen.sharpen", "layer.layerMask.apply", "select.all"] - { - assert!(lang.catalog().id(id).is_some(), "az: missing @id translation for {id:?}"); - } -} - /// Bosnian locales, with or without region, script or encoding, select the Latin catalog. #[test] fn bosnian_resolves_locales_and_preferences() { diff --git a/crates/ui-egui/src/tools/crop_options_labels_tests.rs b/crates/ui-egui/src/tools/crop_options_labels_tests.rs index 50afc4f558..5c8b6fd2dc 100644 --- a/crates/ui-egui/src/tools/crop_options_labels_tests.rs +++ b/crates/ui-egui/src/tools/crop_options_labels_tests.rs @@ -264,15 +264,3 @@ fn box_undo_restores_whether_the_frame_came_from_a_selection() { assert_eq!(app.ui.crop_rect, Some([50.0, 20.0, 150.0, 80.0])); assert!(crop_presets::shows_selection(&app), "redo brings the selection's frame back"); } - -/// The Fill entry's default labels are translated in every catalog that translated the old -/// "Background (Default)" label, so no language falls back to English. -#[test] -fn the_fill_labels_are_translated_where_the_old_label_was() { - use crate::i18n::{Lang, has}; - for lang in Lang::all().filter(|l| has(*l, "Background (Default)")) { - for label in ["Background (default)", "Transparent (default)"] { - assert!(has(lang, label), "{} lacks {label}", lang.code()); - } - } -} diff --git a/crates/ui-egui/src/tools/vector_ui/pen_path_ops_tests.rs b/crates/ui-egui/src/tools/vector_ui/pen_path_ops_tests.rs index f20b688cfc..c12066a1c7 100644 --- a/crates/ui-egui/src/tools/vector_ui/pen_path_ops_tests.rs +++ b/crates/ui-egui/src/tools/vector_ui/pen_path_ops_tests.rs @@ -181,11 +181,6 @@ fn esc_ends_a_refused_draft_and_return_keeps_it() { }; for lang in crate::i18n::Lang::all() { crate::i18n::with_language(lang, || { - for message in ["The path was kept as the Work Path", "The path was discarded"] { - if lang != crate::i18n::Lang::EN { - assert!(crate::i18n::has(lang, message), "{}: {message}", lang.code()); - } - } let mut app = app(); let (id, body, steps) = refused_hole(&mut app); let draft = app.ui.pen.clone(); diff --git a/docs/contributing.md b/docs/contributing.md index aa581b0a02..fa68c6a032 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -6,7 +6,7 @@ - **Never crash:** non-test code must not panic: no `unwrap`/`expect`/`panic!`/`unreachable!`/`todo!`/`unimplemented!` and no `unsafe`. Errors go through `Result` and `?`, input-derived indices and sizes are checked, and every crash fix ships with a regression test. See *Never crash* in `AGENTS.md`. - **Commands, not handlers:** new features are engine commands with tests, and the UI calls them (checklist below). - **Layering:** `cargo xtask layers` must pass. Register new crates in `xtask/src/layers.rs`. -- **Tests:** required for every change. Format code needs round-trip and malformed-input tests. Pixel code is tested at 8, 16 and 32-bit. If you touch psd, io, codecs, compose, gpu, text or format, also run the real-file corpus tests: `cargo xtask test-corpus` (fetches the pinned corpora, including our Photoshop oracles from https://github.com/storytold/photocraft-corpus, then runs the `corpus`-feature tests; CI always runs them). Never commit corpus files; see `docs/development.md` › Test corpora. +- **Tests:** required for every change. Format code needs round-trip and malformed-input tests. Pixel code is tested at 8, 16 and 32-bit. If you touch psd, io, codecs, compose, gpu, text or format, also run the real-file corpus tests: `cargo xtask test-corpus` (fetches the pinned corpora, including our Photoshop oracles from https://github.com/storytold/photocraft-corpus, then runs the `corpus`-feature tests; CI always runs them). Never commit corpus files; see `docs/development.md` › Test corpora. Tests never require a string to be translated: a missing translation shows in English, so no test may fail because a catalog lacks a row (`cargo xtask i18n-coverage` lists the gaps instead). - **Style:** `cargo fmt`, and `cargo clippy -- -D warnings`. Match surrounding code. Comments explain *why*. - **UI:** use `theme::Tokens` and `widgets::*`. Verify visually (offscreen `snapshot` example or the control channel) before submitting, and attach before/after screenshots to PRs. - **Commits:** small, focused, with a clear subject line.