diff --git a/README.md b/README.md index 026256bbca..966258d1b6 100644 --- a/README.md +++ b/README.md @@ -178,8 +178,8 @@ Every screenshot here is the real app at work on public-domain art, rendered off
-

🧰 34 tools

- Move · Rectangular and Elliptical Marquee · Lasso · Polygonal Lasso · Magnetic Lasso · Magic Wand · Quick Selection · Object Selection · Crop · Eyedropper · Brush · Pencil · Mixer Brush · Color Replacement · Eraser · Clone Stamp · Healing Brush · Spot Healing · History Brush · Gradient · Paint Bucket · Blur · Sharpen · Smudge · Dodge · Burn · Sponge · Pen · Path Selection · Type · five Shape tools · Hand · Zoom +

🧰 52 tools

+ Move · Rectangular and Elliptical Marquee · Lasso · Polygonal Lasso · Magnetic Lasso · Object Selection · Quick Selection · Magic Wand · Crop · Slice · Slice Select · Eyedropper · Ruler · Note · Count · Spot Healing Brush · Healing Brush · Patch · Content-Aware Move · Red Eye · Brush · Pencil · Mixer Brush · Clone Stamp · Pattern Stamp · History Brush · Eraser · Background Eraser · Magic Eraser · Gradient · Paint Bucket · Blur · Sharpen · Smudge · Dodge · Burn · Sponge · Pen · Horizontal and Vertical Type · Path Selection · Direct Selection · Rectangle · Ellipse · Triangle · Polygon · Line · Custom Shape · Hand · Rotate View · Zoom

🖌️ A real brush engine

diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index b34217b33b..657a48f1ec 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -1045,6 +1045,29 @@ mod tests { assert_eq!(Tool::from_name("nope"), None); } + /// The README's "Everything in the box" tool heading and list name exactly the tools a user can + /// pick, `Tool::ALL` (#996). + #[test] + fn readme_tool_list_matches_tool_all() { + let readme = include_str!("../../../README.md"); + let (_, rest) = readme.split_once("

🧰 ").unwrap(); + let (count, rest) = rest.split_once(" tools

").unwrap(); + assert_eq!(count.parse::().unwrap(), Tool::ALL.len(), "README.md tool heading"); + let list = rest.trim_start().lines().next().unwrap(); + // "Rectangular and Elliptical Marquee" names two tools: "Rectangular Marquee", "Elliptical Marquee". + let mut named: Vec = Vec::new(); + for entry in list.split(" · ") { + match entry.split_once(" and ").and_then(|(first, rest)| Some((first, rest.split_once(' ')?))) { + Some((first, (second, noun))) => named.extend([format!("{first} {noun}"), format!("{second} {noun}")]), + None => named.push(entry.to_owned()), + } + } + named.sort(); + let mut labels: Vec = Tool::ALL.iter().map(|tool| tool.label().trim_end_matches(" Tool").to_owned()).collect(); + labels.sort(); + assert_eq!(named, labels, "README.md tool list"); + } + #[test] fn dialogs_open_and_close() { let mut s = UiState::default();