[Python-checkins] CVS: python/dist/src/Lib/test test_fpformat.py,1.2,1.3

Fred L. Drake fdrake@users.sourceforge.net
Mon, 23 Jul 2001 09:30:23 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv25222

Modified Files:
	test_fpformat.py 
Log Message:
Make this test work under Windows as well.

Index: test_fpformat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_fpformat.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_fpformat.py	2001/07/23 09:44:21	1.2
--- test_fpformat.py	2001/07/23 16:30:21	1.3
***************
*** 33,38 ****
              n = repr(n)
          expected = "%.*e" % (digits, float(n))
!         # add the extra 0
!         expected = expected[:-2]+'0'+expected[-2:]
  
          self.assertEquals(result, expected)
--- 33,41 ----
              n = repr(n)
          expected = "%.*e" % (digits, float(n))
!         # add the extra 0 if needed
!         num, exp = expected.split("e")
!         if len(exp) < 4:
!             exp = exp[0] + "0" + exp[1:]
!         expected = "%se%s" % (num, exp)
  
          self.assertEquals(result, expected)