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.
22 lines
366 B
Perl
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]
|