Skip to content

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

fix: case-insensitive same-form check in SimplePastToPastParticiple (#3012)

Sascha Buehrleb3de422fda57
diff --git a/harper-core/src/linting/simple_past_to_past_participle.rs b/harper-core/src/linting/simple_past_to_past_participle.rs
index 540cfba0c..5ee0831db 100644
--- a/harper-core/src/linting/simple_past_to_past_participle.rs
+++ b/harper-core/src/linting/simple_past_to_past_participle.rs
@@ -73,7 +73,7 @@ impl ExprLinter for SimplePastToPastParticiple {
if let Some(past_participle) = IrregularVerbs::curated()
.get_past_participle_for_preterite(&simple_past)
- .filter(|pp| pp != &simple_past)
+ .filter(|pp| !pp.eq_ignore_ascii_case(&simple_past))
{
let suggestions = vec![Suggestion::replace_with_match_case(
past_participle.chars().collect(),
@@ -513,4 +513,20 @@ mod tests {
SimplePastToPastParticiple::default(),
);
}
+
+ #[test]
+ fn dont_flag_have_lost_issue_3011() {
+ assert_no_lints(
+ "Elite Universities Have Lost Their Way",
+ SimplePastToPastParticiple::default(),
+ );
+ }
+
+ #[test]
+ fn dont_flag_has_lost() {
+ assert_no_lints(
+ "He has lost his keys.",
+ SimplePastToPastParticiple::default(),
+ );
+ }
}