Skip to content

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

chore: add "day of age" to `DayAndAge` rule (#3272)

Andrew Dunbarc6e0012359a3
diff --git a/harper-core/src/linting/day_and_age.rs b/harper-core/src/linting/day_and_age.rs
index 2174b56fb..319f32a9e 100644
--- a/harper-core/src/linting/day_and_age.rs
+++ b/harper-core/src/linting/day_and_age.rs
@@ -15,7 +15,7 @@ impl Default for DayAndAge {
.t_ws()
.then_word_set(&["day", "days"])
.t_ws()
- .then_word_set(&["and", "in", "an", "on"])
+ .then_word_set(&["and", "in", "an", "on", "of"])
.t_ws()
.then_word_set(&["age", "ages"]),
}
@@ -281,4 +281,13 @@ mod tests {
"and since in this day and age storage is usually not a problem, I usually play it safe and just don't bother",
);
}
+
+ #[test]
+ fn fix_day_of_age() {
+ assert_suggestion_result(
+ "If you want in this day of age an AI agent can probably implement what you are looking for.",
+ DayAndAge::default(),
+ "If you want in this day and age an AI agent can probably implement what you are looking for.",
+ );
+ }
}