Mercurial > public > mercurial-scm > hg-stable
diff tests/test-run-tests.t @ 24811:a2dcf460e141 stable
run-tests: don't error when glob matched line ends with backslash
As part of writing another test, I triggered an array index error in
glob match processing code by having a (glob) line end in a single
backslash (which is the escape character).
Adding a simple bounds check prevents the error in run-tests.py.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 17 Apr 2015 14:12:01 -0700 |
parents | a0668a587c04 |
children | 65e8dac7b016 f44db7343be9 |
line wrap: on
line diff
--- a/tests/test-run-tests.t Fri Apr 17 09:46:43 2015 -0700 +++ b/tests/test-run-tests.t Fri Apr 17 14:12:01 2015 -0700 @@ -491,3 +491,17 @@ } (no-eol) #endif + +backslash on end of line with glob matching is handled properly + + $ cat > test-glob-backslash.t << EOF + > $ echo 'foo bar \\' + > foo * \ (glob) + > EOF + + $ $TESTDIR/run-tests.py --with-hg=`which hg` test-glob-backslash.t + . + # Ran 1 tests, 0 skipped, 0 warned, 0 failed. + + $ rm -f test-glob-backslash.t +