[Git][NTPsec/ntpsec][testutil-fix] 2 commits: xterm/utf-8: explain need for LANG=en_US.utf8

Eric S. Raymond gitlab at mg.gitlab.com
Mon May 8 20:42:30 UTC 2017


Eric S. Raymond pushed to branch testutil-fix at NTPsec / ntpsec


Commits:
62fceb72 by Gary E. Miller at 2017-05-08T13:29:21-07:00
xterm/utf-8: explain need for LANG=en_US.utf8

- - - - -
4e731fcf by Ian Bruene at 2017-05-08T20:42:10+00:00
Fixed unicode errors in tests.

Tests still used the old \u unicode escapes, instead of the literal strings.

- - - - -


2 changed files:

- docs/includes/mrufail.txt
- tests/pylib/test_util.py


Changes:

=====================================
docs/includes/mrufail.txt
=====================================
--- a/docs/includes/mrufail.txt
+++ b/docs/includes/mrufail.txt
@@ -3,7 +3,8 @@
 When using the -u option, very old xterms may fail to render μ
 correctly.  If this happens, be sure your xterm is started with the -u8
 option, or the 'utf8' resource', and that your console font contains
-the UTF-8 &mu character.
+the UTF-8 &mu character.  Also confirm your LANG environment variable is
+set to a UTF-8 language, like this: "export LANG=en_US.utf8".
 
 Timestamp interpretation in this program is likely to fail in flaky
 ways if the local system clock has not already been approximately


=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -177,7 +177,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         nu = ntp.util
 
         # Zero
-        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0\u03bcs")
+        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0µs")
         # Standard, width=8
         self.assertEqual(f("1.234", nu.UNIT_MS), " 1.234ms")
         # ditto, negative
@@ -187,9 +187,9 @@ class TestPylibUtilMethods(unittest.TestCase):
         # ditto, negative
         self.assertEqual(f("-1234.5", nu.UNIT_MS), "-1.2345s")
         # Scale to smaller unit, width=8
-        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34\u03bcs")
+        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34µs")
         # ditto, negative
-        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34\u03bcs")
+        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34µs")
         # At baseunit
         self.assertEqual(f("12.0", nu.UNIT_NS), "    12ns")
         # Scale to baseunit
@@ -226,7 +226,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.470 0.420 0.430 0.500 0.460 0.4200 0.490 0.480"),
             u"    470     420     430     500     460   420.0     490     "
-            "480 \u03bcs")
+            u"480 µs")
         # Can't scale
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.47 0.42 0.43 0.50 0.46 0.42 0.49 0.48"),



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/f108c7da832f70afa52182e25f21df234022d165...4e731fcf421254555da52edad8ef758a750daa6d

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/f108c7da832f70afa52182e25f21df234022d165...4e731fcf421254555da52edad8ef758a750daa6d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170508/311debc8/attachment.html>


More information about the vc mailing list