py3: remove b'' from output of test-eol.t
authorYuya Nishihara <yuya@tcha.org>
Sat, 16 Jun 2018 17:54:29 +0900
changeset 38330 ae3f17a87b28
parent 38329 f47608575c10
child 38331 cf59de802883
py3: remove b'' from output of test-eol.t
contrib/python3-whitelist
tests/test-eol.t
--- a/contrib/python3-whitelist	Sat Jun 16 17:53:51 2018 +0900
+++ b/contrib/python3-whitelist	Sat Jun 16 17:54:29 2018 +0900
@@ -126,6 +126,7 @@
 test-eol-patch.t
 test-eol-tag.t
 test-eol-update.t
+test-eol.t
 test-excessive-merge.t
 test-exchange-obsmarkers-case-A1.t
 test-exchange-obsmarkers-case-A2.t
--- a/tests/test-eol.t	Sat Jun 16 17:53:51 2018 +0900
+++ b/tests/test-eol.t	Sat Jun 16 17:54:29 2018 +0900
@@ -7,7 +7,7 @@
 
 Set up helpers
 
-  $ cat > switch-eol.py <<EOF
+  $ cat > switch-eol.py <<'EOF'
   > from __future__ import absolute_import
   > import os
   > import sys
@@ -17,8 +17,10 @@
   >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
   > except ImportError:
   >     pass
+  > eolmap = {b'\n': '\\n', b'\r\n': '\\r\\n'}
   > (old, new) = sys.argv[1] == 'LF' and (b'\n', b'\r\n') or (b'\r\n', b'\n')
-  > print("%% switching encoding from %r to %r" % (old, new))
+  > print("%% switching encoding from '%s' to '%s'"
+  >       % (eolmap[old], eolmap[new]))
   > for path in sys.argv[2:]:
   >     data = open(path, 'rb').read()
   >     data = data.replace(old, new)