@@ -116,15 +116,33 @@ class TestFixText:
116116 ("\u201e quote\u201f " , '"quote"' ),
117117 ("\u00ab guillemet\u00bb " , '"guillemet"' ),
118118 ("\u2039 angle\u203a " , "'angle'" ),
119- ("word\u2014 word" , "word-- word" ),
120- ("1\u2013 2" , "1-- 2" ),
119+ ("word\u2014 word" , "word-word" ),
120+ ("1\u2013 2" , "1-2" ),
121121 ("x \u2212 y" , "x - y" ),
122122 ("hello\u00a0 world" , "hello world" ),
123123 ("a\u2003 b" , "a b" ),
124124 ("a\u2009 b" , "a b" ),
125125 ("a\u200a b" , "a b" ),
126126 ("a\u3000 b" , "a b" ),
127127 ("wait\u2026 " , "wait..." ),
128+ ("a\u2010 b" , "a-b" ),
129+ ("a\u2011 b" , "a-b" ),
130+ ("a\u2012 b" , "a-b" ),
131+ ("a\u2015 b" , "a-b" ),
132+ ("a\ufe58 b" , "a-b" ),
133+ ("soft\u00ad hyphen" , "softhyphen" ),
134+ ("\u2022 item" , "* item" ),
135+ ("\u2023 item" , "* item" ),
136+ ("\u2043 item" , "- item" ),
137+ ("ch\u2024 1" , "ch.1" ),
138+ ("ch\u2025 1" , "ch..1" ),
139+ ("a \u2192 b" , "a -> b" ),
140+ ("b \u2190 a" , "b <- a" ),
141+ ("\u2191 up" , "^up" ),
142+ ("\u2193 down" , "vdown" ),
143+ ("2 \u00d7 3" , "2 x 3" ),
144+ ("6 \u00f7 2" , "6 / 2" ),
145+ ("1\u2044 2" , "1/2" ),
128146 ],
129147 ids = [
130148 "smart-double-quotes" ,
@@ -143,6 +161,24 @@ class TestFixText:
143161 "hair-space" ,
144162 "ideographic-space" ,
145163 "ellipsis" ,
164+ "hyphen" ,
165+ "non-breaking-hyphen" ,
166+ "figure-dash" ,
167+ "horizontal-bar" ,
168+ "small-em-dash" ,
169+ "soft-hyphen" ,
170+ "bullet" ,
171+ "triangular-bullet" ,
172+ "hyphen-bullet" ,
173+ "one-dot-leader" ,
174+ "two-dot-leader" ,
175+ "right-arrow" ,
176+ "left-arrow" ,
177+ "up-arrow" ,
178+ "down-arrow" ,
179+ "multiplication-sign" ,
180+ "division-sign" ,
181+ "fraction-slash" ,
146182 ],
147183 )
148184 def test_fix_replaces_character (self , input_text : str , expected : str ) -> None :
@@ -169,7 +205,7 @@ def test_mixed_fixable_nonfixable_dangerous(self) -> None:
169205 def test_multiline_text (self ) -> None :
170206 """fix_text handles multi-line strings correctly."""
171207 text = "line1 \u201c hi\u201d \n line2 word\u2014 word\n line3 wait\u2026 \n "
172- expected = 'line1 "hi"\n line2 word-- word\n line3 wait...\n '
208+ expected = 'line1 "hi"\n line2 word-word\n line3 wait...\n '
173209 assert fix_text (text ) == expected
174210
175211
@@ -182,8 +218,8 @@ class TestFixFileReplacements:
182218 ("\u201c hello\u201d " , '"hello"' ),
183219 ("It\u2019 s" , "It's" ),
184220 ("\u2018 word\u2019 " , "'word'" ),
185- ("word\u2014 word" , "word-- word" ),
186- ("1\u2013 2" , "1-- 2" ),
221+ ("word\u2014 word" , "word-word" ),
222+ ("1\u2013 2" , "1-2" ),
187223 ("x \u2212 y" , "x - y" ),
188224 ("hello\u00a0 world" , "hello world" ),
189225 ("a\u2003 b" , "a b" ),
0 commit comments