changeset 38339:ae3f17a87b28

py3: remove b'' from output of test-eol.t
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Jun 2018 17:54:29 +0900
parents f47608575c10
children cf59de802883
files contrib/python3-whitelist tests/test-eol.t
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)