the_silver_searcher/tests/exitcodes.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

22 lines
366 B
Perl

Setup:
$ . $TESTDIR/setup.sh
$ printf 'foo\n' > ./exitcodes_test.txt
$ printf 'bar\n' >> ./exitcodes_test.txt
Normal matching:
$ ag foo exitcodes_test.txt
1:foo
$ ag zoo exitcodes_test.txt
[1]
Inverted matching:
$ ag -v foo exitcodes_test.txt
2:bar
$ ag -v zoo exitcodes_test.txt
1:foo
2:bar
$ ag -v "foo|bar" exitcodes_test.txt
[1]