From 593c425df46ac418f7302bd8c50049ff040f3e40 Mon Sep 17 00:00:00 2001 From: vaibhavsarmai Date: Wed, 28 Oct 2026 11:20:43 +0530 Subject: [PATCH] test: add Unicode coverage for word counting --- tests/test_wordcount.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_wordcount.py b/tests/test_wordcount.py index 3c3df7f..2066680 100644 --- a/tests/test_wordcount.py +++ b/tests/test_wordcount.py @@ -46,3 +46,18 @@ def test_top_words_empty_text(): def test_top_words_requires_positive_n(): with pytest.raises(ValueError, match="at least 1"): top_words("hello", 0) + +def test_count_chars_accented_text(): + assert count_chars("café") == 4 + + +def test_count_chars_multi_codepoint_emoji(): + assert count_chars("❤️") == 2 + + +def test_count_words_accented_text(): + assert count_words("café naïve") == 2 + + +def test_count_words_hindi_text(): + assert count_words("नमस्ते दुनिया") == 2