[Python-checkins] CVS: python/dist/src/Lib/test test_format.py,1.2,1.3
Tim Peters
python-dev@python.org
Wed, 29 Nov 2000 21:23:16 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4750/python/dist/src/Lib/test
Modified Files:
test_format.py
Log Message:
Fox for SF bug #123859: %[duxXo] long formats inconsistent.
Index: test_format.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_format.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_format.py 2000/09/21 05:43:11 1.2
--- test_format.py 2000/11/30 05:22:41 1.3
***************
*** 64,72 ****
testboth("%d", 100000000000L, "100000000000")
- # Make sure big is too big to fit in a 64-bit int, else the unbounded
- # int formatting will be sidestepped on some machines. That's vital,
- # because bitwise (x, X, o) formats of regular Python ints never
- # produce a sign ("+" or "-").
-
big = 123456789012345678901234567890L
testboth("%d", big, "123456789012345678901234567890")
--- 64,67 ----
***************
*** 164,165 ****
--- 159,176 ----
# base marker shouldn't change that
testboth("%0#34.33o", big, "0012345670123456701234567012345670")
+
+ # Some small ints, in both Python int and long flavors).
+ testboth("%d", 42, "42")
+ testboth("%d", -42, "-42")
+ testboth("%d", 42L, "42")
+ testboth("%d", -42L, "-42")
+
+ testboth("%x", 0x42, "42")
+ # testboth("%x", -0x42, "ffffffbe") # Alas, that's specific to 32-bit machines
+ testboth("%x", 0x42L, "42")
+ testboth("%x", -0x42L, "-42")
+
+ testboth("%o", 042, "42")
+ # testboth("%o", -042, "37777777736") # Alas, that's specific to 32-bit machines
+ testboth("%o", 042L, "42")
+ testboth("%o", -042L, "-42")