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

45 lines
604 B
Perl

Setup:
$ . $TESTDIR/setup.sh
$ printf 'Foo\n' >> ./sample
$ printf 'bar\n' >> ./sample
Smart case by default:
$ ag foo sample
1:Foo
$ ag FOO sample
[1]
$ ag 'f.o' sample
1:Foo
$ ag Foo sample
1:Foo
$ ag 'F.o' sample
1:Foo
Case sensitive mode:
$ ag -s foo sample
[1]
$ ag -s FOO sample
[1]
$ ag -s 'f.o' sample
[1]
$ ag -s Foo sample
1:Foo
$ ag -s 'F.o' sample
1:Foo
Case insensitive mode:
$ ag fOO -i sample
1:Foo
$ ag fOO --ignore-case sample
1:Foo
$ ag 'f.o' -i sample
1:Foo
Case insensitive file regex
$ ag -i -g 'Samp.*'
sample