Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
test: #2233 and #1097 (#2239)
Elijah Potter230e1424049c
diff --git a/harper-comments/tests/language_support.rs b/harper-comments/tests/language_support.rsindex 3a87d23ca..8a0683f6c 100644--- a/harper-comments/tests/language_support.rs+++ b/harper-comments/tests/language_support.rs@@ -61,6 +61,7 @@ create_test!(ignore_shebang_3.sh, 0);create_test!(ignore_shebang_4.sh, 1);create_test!(common.mill, 1);create_test!(basic_kotlin.kt, 0);+create_test!(issue_1097.lua, 0);create_test!(basic.clj, 12);// Checks that some comments are masked outdiff --git a/harper-comments/tests/language_support_sources/issue_1097.lua b/harper-comments/tests/language_support_sources/issue_1097.luanew file mode 100644index 000000000..c3d06b76e--- /dev/null+++ b/harper-comments/tests/language_support_sources/issue_1097.lua@@ -0,0 +1,3 @@+---Starting with something capitalized, but without dot at the end+---@type table<string, string>+local f = {} -- ending with a dot.diff --git a/harper-core/src/linting/comma_fixes.rs b/harper-core/src/linting/comma_fixes.rsindex 2f102b464..15e9ca8b3 100644--- a/harper-core/src/linting/comma_fixes.rs+++ b/harper-core/src/linting/comma_fixes.rs@@ -118,7 +118,7 @@ impl Linter for CommaFixes {#[cfg(test)]mod tests {use super::CommaFixes;- use crate::linting::tests::{assert_lint_count, assert_suggestion_result};+ use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};#[test]fn allows_english_comma_atomic() {@@ -203,4 +203,12 @@ mod tests {fn doesnt_correct_comma_between_non_english_tokens() {assert_lint_count("严禁采摘花、 果、叶,挖掘树根、草药!", CommaFixes, 0);}++ #[test]+ fn issue_2233() {+ assert_no_lints(+ "In foobar, apple is a fruit, and \"beer\" is not a fruit.",+ CommaFixes,+ );+ }}diff --git a/harper-core/tests/run_tests.rs b/harper-core/tests/run_tests.rsindex 3a858fb40..61b8df5e0 100644--- a/harper-core/tests/run_tests.rs+++ b/harper-core/tests/run_tests.rs@@ -91,6 +91,7 @@ create_test!(issue_1581.md, 0, Dialect::British);create_test!(issue_2054.md, 6, Dialect::British);create_test!(issue_2054_clean.md, 0, Dialect::British);create_test!(issue_1873.md, 0, Dialect::British);+create_test!(issue_2233.md, 0, Dialect::American);// It just matters that it is > 1create_test!(issue_2151.md, 4, Dialect::British);diff --git a/harper-core/tests/test_sources/issue_2233.md b/harper-core/tests/test_sources/issue_2233.mdnew file mode 100644index 000000000..36dfaa5ee--- /dev/null+++ b/harper-core/tests/test_sources/issue_2233.md@@ -0,0 +1 @@+In foobar, apple is a fruit, and "beer" is not a fruit.