changeset 30952:f61c5680a862

ui: fix configwith doctest 4.2 cannot be expressed with IEEE floating point losslessly, and could cause test failure on some platform: File ".../mercurial/ui.py", line 414, in mercurial.ui.ui.configwith Failed example: u.configwith(float, s, 'float2') Expected: -4.2 Got: -4.2000000000000002 This patch fixes that by changing the number to 4.25, which can be expressed by the binary number 100.01.
author Jun Wu <quark@fb.com>
date Mon, 13 Feb 2017 21:00:50 -0800
parents f2ad0d804700
children 69a3c6c8bf95
files mercurial/ui.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Tue Feb 14 01:52:16 2017 +0530
+++ b/mercurial/ui.py	Mon Feb 13 21:00:50 2017 -0800
@@ -410,9 +410,9 @@
         >>> u.setconfig(s, 'float1', '42')
         >>> u.configwith(float, s, 'float1')
         42.0
-        >>> u.setconfig(s, 'float2', '-4.2')
+        >>> u.setconfig(s, 'float2', '-4.25')
         >>> u.configwith(float, s, 'float2')
-        -4.2
+        -4.25
         >>> u.configwith(float, s, 'unknown', 7)
         7
         >>> u.setconfig(s, 'invalid', 'somevalue')