@@ -200,42 +200,28 @@ def test_common_format(self):
200200 testcommon ("%#+37.34o" , big , "+0o0012345670123456701234567012345670" )
201201 # next one gets one leading zero from precision
202202 testcommon ("%.33o" , big , "012345670123456701234567012345670" )
203- # base marker shouldn't change that, since "0" is redundant
203+ # base marker added in spite of leading zero (different to Python 2)
204204 testcommon ("%#.33o" , big , "0o012345670123456701234567012345670" )
205- # but reduce precision, and base marker should add a zero
205+ # reduce precision, and base marker is always added
206206 testcommon ("%#.32o" , big , "0o12345670123456701234567012345670" )
207- # one leading zero from precision, and another from "0" flag & width
208- testcommon ("%034 .33o" , big , "0012345670123456701234567012345670 " )
209- # base marker shouldn't change that
210- testcommon ("%0#34 .33o" , big , "0o012345670123456701234567012345670" )
207+ # one leading zero from precision, plus two from "0" flag & width
208+ testcommon ("%035 .33o" , big , "00012345670123456701234567012345670 " )
209+ # base marker shouldn't change the size
210+ testcommon ("%0#35 .33o" , big , "0o012345670123456701234567012345670" )
211211 # Some small ints, in both Python int and flavors).
212212 testcommon ("%d" , 42 , "42" )
213213 testcommon ("%d" , - 42 , "-42" )
214- testcommon ("%d" , 42 , "42" )
215- testcommon ("%d" , - 42 , "-42" )
216214 testcommon ("%d" , 42.0 , "42" )
217215 testcommon ("%#x" , 1 , "0x1" )
218- testcommon ("%#x" , 1 , "0x1" )
219- testcommon ("%#X" , 1 , "0X1" )
220216 testcommon ("%#X" , 1 , "0X1" )
221217 testcommon ("%#o" , 1 , "0o1" )
222- testcommon ("%#o" , 1 , "0o1" )
223- testcommon ("%#o" , 0 , "0o0" )
224218 testcommon ("%#o" , 0 , "0o0" )
225219 testcommon ("%o" , 0 , "0" )
226- testcommon ("%o" , 0 , "0" )
227220 testcommon ("%d" , 0 , "0" )
228- testcommon ("%d" , 0 , "0" )
229- testcommon ("%#x" , 0 , "0x0" )
230221 testcommon ("%#x" , 0 , "0x0" )
231222 testcommon ("%#X" , 0 , "0X0" )
232- testcommon ("%#X" , 0 , "0X0" )
233223 testcommon ("%x" , 0x42 , "42" )
234224 testcommon ("%x" , - 0x42 , "-42" )
235- testcommon ("%x" , 0x42 , "42" )
236- testcommon ("%x" , - 0x42 , "-42" )
237- testcommon ("%o" , 0o42 , "42" )
238- testcommon ("%o" , - 0o42 , "-42" )
239225 testcommon ("%o" , 0o42 , "42" )
240226 testcommon ("%o" , - 0o42 , "-42" )
241227 # alternate float formatting
0 commit comments