# Copyright (c) 2026 Krzysztof Rudnicki. MIT licence. """Polish number agreement, which the group notices the moment it is wrong.""" from __future__ import annotations import pytest from signal_bot.stats import text @pytest.mark.parametrize( ("count", "expected"), [ (0, "0 znaków"), (1, "1 znak"), (2, "2 znaki"), (4, "4 znaki"), (5, "5 znaków"), (11, "11 znaków"), # The teens take the many-form even though they end in 2, 3 and 4 -- # the rule reads the last two digits, not the last one. (12, "12 znaków"), (13, "13 znaków"), (14, "14 znaków"), (21, "21 znaków"), (22, "22 znaki"), (24, "24 znaki"), (25, "25 znaków"), (44, "44 znaki"), (112, "112 znaków"), (122, "122 znaki"), ], ) def test_characters_agree(count: int, expected: str) -> None: assert text.characters(count) == expected @pytest.mark.parametrize( ("count", "expected"), [(1, "1 wiadomość"), (2, "2 wiadomości"), (5, "5 wiadomości"), (220, "220 wiadomości")], ) def test_messages_agree(count: int, expected: str) -> None: assert text.messages(count) == expected @pytest.mark.parametrize( ("count", "expected"), [(1, "1 komenda"), (4, "4 komendy"), (5, "5 komend")] ) def test_commands_agree(count: int, expected: str) -> None: assert text.commands(count) == expected @pytest.mark.parametrize(("count", "expected"), [(1, "1 osoba"), (3, "3 osoby"), (7, "7 osób")]) def test_people_agree(count: int, expected: str) -> None: assert text.people(count) == expected @pytest.mark.parametrize(("count", "expected"), [(1, "1 dzień"), (2, "2 dni"), (9, "9 dni")]) def test_days_agree(count: int, expected: str) -> None: assert text.days(count) == expected