Skip to content

Commit 7042dbc

Browse files
mmaxjrclaude
andcommitted
test: add regression coverage for ordinal indicators (º, ª)
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 <noreply@anthropic.com>
1 parent 7b6d5d9 commit 7042dbc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ def test_accented_text(self):
4949
r = slugify(txt)
5050
self.assertEqual(r, "nin-hao-wo-shi-zhong-guo-ren")
5151

52+
def test_ordinal_indicators(self):
53+
# Portuguese/Spanish masculine/feminine ordinal indicators (º, ª),
54+
# common on Portuguese keyboards - see issue #172.
55+
txt = '1º lugar, 1ª colocada'
56+
r = slugify(txt)
57+
self.assertEqual(r, "1o-lugar-1a-colocada")
58+
5259
def test_accented_text_with_non_word_characters(self):
5360
txt = 'jaja---lol-méméméoo--a'
5461
r = slugify(txt)

0 commit comments

Comments
 (0)