diff tests/test-eol.t @ 38330: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 b85b0bbed6de
children 5abc47d4ca6b
line wrap: on
line diff
--- 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)