Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
test(core): create sample of "British" English
Elijah Potterd8dbb66afae4
diff --git a/harper-core/tests/run_tests.rs b/harper-core/tests/run_tests.rsindex b7ab9529e..5a3729153 100644--- a/harper-core/tests/run_tests.rs+++ b/harper-core/tests/run_tests.rs@@ -4,7 +4,7 @@ use harper_core::{Dialect, Document, FstDictionary};/// Creates a unit test checking that the linting of a Markdown document (in/// `tests_sources`) produces the expected number of lints.macro_rules! create_test {- ($filename:ident.md, $correct_expected:expr) => {+ ($filename:ident.md, $correct_expected:expr, $dialect:expr) => {paste::paste! {#[test]fn [<lints_ $filename _correctly>](){@@ -18,7 +18,7 @@ macro_rules! create_test {let dict = FstDictionary::curated();let document = Document::new_markdown_default(&source, &dict);- let mut linter = LintGroup::new_curated(dict, Dialect::American);+ let mut linter = LintGroup::new_curated(dict, $dialect);let lints = linter.lint(&document);dbg!(&lints);@@ -33,25 +33,26 @@ macro_rules! create_test {};}-create_test!(whack_bullets.md, 1);-create_test!(preexisting.md, 0);-create_test!(issue_109.md, 0);-create_test!(issue_109_ext.md, 0);-create_test!(chinese_lorem_ipsum.md, 2);-create_test!(obsidian_links.md, 2);-create_test!(issue_267.md, 0);-create_test!(proper_noun_capitalization.md, 2);-create_test!(amazon_hostname.md, 0);-create_test!(issue_159.md, 1);-create_test!(issue_358.md, 0);-create_test!(issue_195.md, 0);-create_test!(issue_118.md, 0);-create_test!(lots_of_latin.md, 0);-create_test!(pr_504.md, 1);-create_test!(pr_452.md, 2);-create_test!(hex_basic_clean.md, 0);-create_test!(hex_basic_dirty.md, 1);-create_test!(misc_closed_compound_clean.md, 0);+create_test!(whack_bullets.md, 1, Dialect::American);+create_test!(preexisting.md, 0, Dialect::American);+create_test!(issue_109.md, 0, Dialect::American);+create_test!(issue_109_ext.md, 0, Dialect::American);+create_test!(chinese_lorem_ipsum.md, 2, Dialect::American);+create_test!(obsidian_links.md, 2, Dialect::American);+create_test!(issue_267.md, 0, Dialect::American);+create_test!(proper_noun_capitalization.md, 2, Dialect::American);+create_test!(amazon_hostname.md, 0, Dialect::American);+create_test!(issue_159.md, 1, Dialect::American);+create_test!(issue_358.md, 0, Dialect::American);+create_test!(issue_195.md, 0, Dialect::American);+create_test!(issue_118.md, 0, Dialect::American);+create_test!(lots_of_latin.md, 0, Dialect::American);+create_test!(pr_504.md, 1, Dialect::American);+create_test!(pr_452.md, 2, Dialect::American);+create_test!(hex_basic_clean.md, 0, Dialect::American);+create_test!(hex_basic_dirty.md, 1, Dialect::American);+create_test!(misc_closed_compound_clean.md, 0, Dialect::American);+create_test!(yogurt_british_clean.md, 0, Dialect::British);// Make sure it doesn't panic-create_test!(lukas_homework.md, 3);+create_test!(lukas_homework.md, 3, Dialect::American);diff --git a/harper-core/tests/test_sources/yogurt_british_clean.md b/harper-core/tests/test_sources/yogurt_british_clean.mdnew file mode 100644index 000000000..83f827de3--- /dev/null+++ b/harper-core/tests/test_sources/yogurt_british_clean.md@@ -0,0 +1,18 @@+The following essay should produce no errors when Harper is set to British English.++Yoghurt, a simple yet remarkably versatile food, has a rich history that stretches back thousands of years. Originating from the ancient civilizations of the Middle East and Central Asia, yoghurt has transcended geographical boundaries, becoming a staple in diets around the globe.++Historically, yoghurt was discovered by chance, likely from milk stored in warm climates naturally turning into a cultured product. This process, involving beneficial bacteria, not only preserves milk but also enhances its nutritional value, digestibility, and flavour. Over centuries, yoghurt evolved from a basic dietary component into a diverse food enjoyed in numerous culinary traditions.++The versatility of yoghurt is evident in its varied uses across different cuisines. In Mediterranean and Middle Eastern dishes, yoghurt often accompanies savoury meals, acting as a refreshing complement to spicy flavours. Tzatziki, a blend of yoghurt, cucumber, garlic, and mint, exemplifies this culinary tradition. Similarly, Indian cuisine features yoghurt prominently, using it as the base for marinades.++Yoghurt is not just a savoury food; it is equally embraced in sweet dishes. Its creamy texture and tangy taste make it ideal for desserts, smoothies, and breakfast dishes. In European countries, yoghurt mixed with fresh fruit, granola, and honey is a popular breakfast or snack option, providing a nutritious and delicious start to the day.++Nutritionally, yoghurt is celebrated for its health benefits. It is rich in protein, calcium, vitamins, and probiotics—live bacteria that support digestive health and immune function. These beneficial bacteria contribute to maintaining a balanced gut microbiome, essential for overall wellness. The popularity of yoghurt has further increased with rising consumer awareness about gut health and nutrition, fuelling innovations in dairy and plant-based yoghurt alternatives.++The production methods of yoghurt have evolved significantly over time, from traditional artisanal practices to advanced industrial techniques. Modern yoghurt manufacturing employs precise control of temperature, bacterial cultures, and incubation processes to ensure consistent quality, taste, and nutritional content. Additionally, innovations in packaging and preservation have expanded yoghurt's accessibility and convenience, making it an ubiquitous presence in supermarkets worldwide.++However, yoghurt production and consumption also present certain challenges. Concerns around sustainability, environmental impact, and ethical dairy farming practices have encouraged a shift toward organic and plant-based alternatives. This has spurred market growth for non-dairy yoghurts made from ingredients such as coconut, almond, oat, and soy, reflecting evolving consumer preferences and dietary needs.++In conclusion, yoghurt is much more than a simple dairy product—it is a cultural and nutritional cornerstone that continues to adapt and thrive across global culinary traditions. Its enduring popularity is a testament to its delicious versatility, health benefits, and adaptability to changing dietary trends, ensuring yoghurt's continued prominence in diets around the world.+