ui: fix configwith doctest
authorJun Wu <quark@fb.com>
Mon, 13 Feb 2017 21:00:50 -0800
changeset 30932 f61c5680a862
parent 30931 f2ad0d804700
child 30933 69a3c6c8bf95
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.
mercurial/ui.py
--- 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')