the_silver_searcher/tests/multiline.t
Adam Dinwoodie 1f2d79ebee Use printf in place of echo in tests
The behaviour of echo is inconsistent between implementations, in
particular regarding whether it expands escapes like `\n`.  Use printf
consistently in test scripts to avoid test failures from inconsistent
echo behaviour.

Fixes #866.
2016-03-15 03:42:19 +00:00

23 lines
365 B
Perl

Setup:
$ . $TESTDIR/setup.sh
$ printf 'what\n' > blah.txt
$ printf 'ever\n' >> blah.txt
$ printf 'whatever\n' >> blah.txt
Multiline:
$ ag 'wh[^w]+er' .
blah.txt:1:what
blah.txt:2:ever
blah.txt:3:whatever
No multiline:
$ ag --nomultiline 'wh[^w]+er' .
blah.txt:3:whatever
Multiline explicit:
$ ag '^wh[^w\n]+er$' .
blah.txt:3:whatever