Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: add key stroke→keystroke to key stoke→keystroke (#3067)

Andrew Dunbare6aace30f4f5
diff --git a/harper-core/src/linting/closed_compounds.rs b/harper-core/src/linting/closed_compounds.rs
index 06c60ef7b..2778248d4 100644
--- a/harper-core/src/linting/closed_compounds.rs
+++ b/harper-core/src/linting/closed_compounds.rs
@@ -40,8 +40,8 @@ pub fn lint_group() -> LintGroup {
"Instead" => (&["in stead"][..], "instead"),
"Intact" => (&["in tact"][..], "intact"),
"Itself" => (&["it self"][..], "itself"),
- "Keystroke" => (&["key stoke"][..], "keystroke"),
- "Keystrokes" => (&["key stokes"][..], "keystrokes"),
+ "Keystroke" => (&["key stoke", "key stroke"][..], "keystroke"),
+ "Keystrokes" => (&["key stokes", "key strokes"][..], "keystrokes"),
"Laptop" => (&["lap top"][..], "laptop"),
"Middleware" => (&["middle ware"][..], "middleware"),
"Misunderstand" => (&["miss understand"][..], "misunderstand"),
@@ -280,6 +280,13 @@ mod tests {
assert_suggestion_result(test_sentence, lint_group(), expected);
}
+ #[test]
+ fn key_strokes() {
+ let test_sentence = "There may have been a missing key stroke.";
+ let expected = "There may have been a missing keystroke.";
+ assert_suggestion_result(test_sentence, lint_group(), expected);
+ }
+
#[test]
fn with_out() {
let test_sentence = "We left with out a map.";