@@ -67,7 +67,6 @@ def test_as_compact_int(input_value: int, expected_output: str) -> None:
6767 """Verify compact integer formatting with magnitude-based suffixes (K, M, B, T)."""
6868
6969 assert fmt .as_compact (input_value ) == expected_output
70- assert fmt .as_compact (input_value ) == expected_output
7170
7271
7372@pytest .mark .parametrize (
@@ -126,6 +125,42 @@ def test_as_enum(input_value: QuoteType | None, expected_output: str) -> None:
126125 assert fmt .as_enum (input_value ) == expected_output
127126
128127
128+ @pytest .mark .parametrize (
129+ ("input_value" , "expected_output" ),
130+ [
131+ pytest .param (
132+ "multiple___underscores" ,
133+ "Multiple Underscores" ,
134+ id = "multiple-underscores" ,
135+ ),
136+ pytest .param (
137+ "__leading_trailing__" ,
138+ "Leading Trailing" ,
139+ id = "leading-trailing-underscores" ,
140+ ),
141+ pytest .param (
142+ "Already Title Cased" ,
143+ "Already Title Cased" ,
144+ id = "already-title-cased" ,
145+ ),
146+ pytest .param (
147+ "already_title_cased" ,
148+ "Already Title Cased" ,
149+ id = "underscore-title-cased" ,
150+ ),
151+ pytest .param (
152+ "mixed__CAPS__and__case" ,
153+ "Mixed Caps And Case" ,
154+ id = "mixed-case" ,
155+ ),
156+ ],
157+ )
158+ def test_as_title_case (input_value : str , expected_output : str ) -> None :
159+ """Verify title casing collapses underscores and normalizes capitalization."""
160+
161+ assert fmt ._as_title_case (input_value ) == expected_output
162+
163+
129164@pytest .mark .parametrize (
130165 ("input_value" , "expected_output" ),
131166 [
0 commit comments