Patchwork D8336: tests: use `f --hexdump` to print file content

login
register
mail settings
Submitter phabricator
Date April 1, 2020, 3:23 p.m.
Message ID <01d2e7478031500229bede700cd336eb@localhost.localdomain>
Download mbox | patch
Permalink /patch/45971/
State Not Applicable
Headers show

Comments

phabricator - April 1, 2020, 3:23 p.m.
Closed by commit rHGda9b7f9635a2: tests: use `f --hexdump` to print file content (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8336?vs=20902&id=20941

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8336/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8336

AFFECTED FILES
  tests/test-mactext.t

CHANGE DETAILS




To: indygreg, #hg-reviewers, marmoute
Cc: marmoute, mercurial-devel

Patch

diff --git a/tests/test-mactext.t b/tests/test-mactext.t
--- a/tests/test-mactext.t
+++ b/tests/test-mactext.t
@@ -7,10 +7,6 @@ 
   >     data = data.replace(b'\n', b'\r')
   >     open(path, 'wb').write(data)
   > EOF
-  $ cat > print.py <<EOF
-  > import sys
-  > print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
-  > EOF
   $ hg init
   $ echo '[hooks]' >> .hg/hgrc
   $ echo 'pretxncommit.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc
@@ -32,7 +28,9 @@ 
   rollback completed
   abort: pretxncommit.cr hook failed
   [255]
-  $ hg cat f | "$PYTHON" print.py
-  hello<LF>
-  $ cat f | "$PYTHON" print.py
-  hello<CR>
+  $ hg cat f | f --hexdump
+  
+  0000: 68 65 6c 6c 6f 0a                               |hello.|
+  $ f --hexdump f
+  f:
+  0000: 68 65 6c 6c 6f 0d                               |hello.|