changeset 40564:0df4d93fdc27

tests: replace `tac` reimplementation by `sort -r` `sort -r` is better code "formatter" than `tac` since it's stable. It's also portable so we don't need to reimplement it in Python. Differential Revision: https://phab.mercurial-scm.org/D5239
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 07 Nov 2018 10:29:38 -0800
parents 2ad56a9b983b
children 71b8ad0ef3e0
files tests/test-fix.t
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-fix.t	Wed Nov 07 12:15:36 2018 -0500
+++ b/tests/test-fix.t	Wed Nov 07 10:29:38 2018 -0800
@@ -1,11 +1,6 @@
 A script that implements uppercasing of specific lines in a file. This
 approximates the behavior of code formatters well enough for our tests.
 
-  $ TAC="$TESTTMP/tac.py"
-  $ cat > $TAC <<EOF
-  > import sys
-  > print('\n'.join(sys.stdin.read().splitlines()[::-1]))
-  > EOF
   $ UPPERCASEPY="$TESTTMP/uppercase.py"
   $ cat > $UPPERCASEPY <<EOF
   > import sys
@@ -1122,7 +1117,7 @@
   $ printf "first\nsecond\n" > bar.txt
   $ hg add -q
   $ hg fix -w --config fix.sometool:fileset=bar.txt \
-  >           --config fix.sometool:command="$PYTHON $TAC"
+  >           --config fix.sometool:command="sort -r"
   the fix.tool:fileset config name is deprecated; please rename it to fix.tool:pattern
 
   $ cat foo.whole