# HG changeset patch # User Jun Wu # Date 2017-02-14 05:00:50 # Node ID f61c5680a86264f153e46f267d84d5d3832aeeca # Parent f2ad0d8047009e6e58ab1fa34ae7107714f5dc30 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. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -410,9 +410,9 @@ class ui(object): >>> 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')