From 7042dbc07dea67209326eaaedcb784281ebe218b Mon Sep 17 00:00:00 2001 From: mmaxjr Date: Sat, 1 Aug 2026 13:26:12 -0300 Subject: [PATCH] =?UTF-8?q?test:=20add=20regression=20coverage=20for=20ord?= =?UTF-8?q?inal=20indicators=20(=C2=BA,=20=C2=AA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #172 reported that slugify() doesn't transliterate the masculine/ feminine ordinal indicators (º, ª) common on Portuguese keyboards. Verified against both supported transliteration backends (text-unidecode>=1.3 and Unidecode>=1.1.1): both already map these correctly (º->o, ª->a) via their Latin-1 Supplement tables, so the bug no longer reproduces on the current codebase. Adding a regression test to lock in the correct behavior and close out the issue. Closes #172 Co-Authored-By: Claude Sonnet 4.6 --- test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test.py b/test.py index fcec4b6..c88c8ae 100644 --- a/test.py +++ b/test.py @@ -49,6 +49,13 @@ def test_accented_text(self): r = slugify(txt) self.assertEqual(r, "nin-hao-wo-shi-zhong-guo-ren") + def test_ordinal_indicators(self): + # Portuguese/Spanish masculine/feminine ordinal indicators (º, ª), + # common on Portuguese keyboards - see issue #172. + txt = '1º lugar, 1ª colocada' + r = slugify(txt) + self.assertEqual(r, "1o-lugar-1a-colocada") + def test_accented_text_with_non_word_characters(self): txt = 'jaja---lol-méméméoo--a' r = slugify(txt)