aiiie / cram

Functional tests for command line applications
GNU General Public License v2.0
199 stars 51 forks source link

-i: "Hunk #1 FAILED at 1." error #42

Open greg-minshall opened 2 years ago

greg-minshall commented 2 years ago

hi (and many thanks for cram!). my .t file looks like

some backref errors

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\2/') < /dev/null

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{2}/') < /dev/null

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{1/') < /dev/null

and, my .t.err file is

some backref errors

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\2/') < /dev/null
  /dev/fd/63:1: backreference "\2" too high (1 max)
  [3]

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{2}/') < /dev/null
  /dev/fd/63:1: backreference "\2" too high (1 max)
  [3]

  $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{1/') < /dev/null
  /dev/fd/63:1: unable to find backreference closing ("}") in "\g{1"
  [3]

the cram run looks like

bash apollo2 (main): {50016} cram -i tests/cram/sed-backref.t
!
--- tests/cram/sed-backref.t
+++ tests/cram/sed-backref.t.err
@@ -1,7 +1,13 @@
 some backref errors

   $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\2/') < /dev/null
+  /dev/fd/63:1: backreference "\2" too high (1 max)
+  [3]

   $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{2}/') < /dev/null
+  /dev/fd/63:1: backreference "\2" too high (1 max)
+  [3]

   $ cd ${TESTDIR}/../.. && ./sedcsv -f <(echo 's/(this)/\g{1/') < /dev/null
+  /dev/fd/63:1: unable to find backreference closing ("}") in "\g{1"
+  [3]
Accept this change? [yN] y
patching file tests/cram/sed-backref.t
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file tests/cram/sed-backref.t.rej
tests/cram/sed-backref.t: merge failed

# Ran 1 tests, 0 skipped, 1 failed.

i'm on an up-to-date arch linux. patch(1) is

bash apollo2 (master): {49628} patch --version
GNU patch 2.7.6
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall

cheers.