A very simple "make test" that uses cram and contains one test, based on

the fine work by @sjl a year ago. To use:

$ sudo easy_install cram
$ ./build.sh
$ make test
This commit is contained in:
amd 2014-01-01 16:13:41 -08:00
parent 1b203683b8
commit ffb764ba87
4 changed files with 32 additions and 0 deletions

1
.gitignore vendored
View file

@ -22,4 +22,5 @@ Makefile.in
missing
src/config.h*
stamp-h1
tests/*.err
the_silver_searcher.spec

View file

@ -13,3 +13,6 @@ dist_bashcomp_DATA = ag.bashcomp.sh
#CFLAGS=-pg
EXTRA_DIST = Makefile.w32 LICENSE NOTICE the_silver_searcher.spec README.md
test:
cram -v tests/*.t

24
tests/case_sensitivity.t Normal file
View file

@ -0,0 +1,24 @@
Setup:
$ source $TESTDIR/setup.sh
$ echo Foo >> ./sample
$ echo bar >> ./sample
Case sensitive by default:
$ ag foo sample
$ ag FOO sample
$ ag 'f.o' sample
$ ag Foo sample
Foo
$ ag 'F.o' sample
Foo
Case insensitive mode:
$ ag foo -i sample
Foo
$ ag foo --ignore-case sample
Foo
$ ag 'f.o' -i sample
Foo

4
tests/setup.sh Executable file
View file

@ -0,0 +1,4 @@
# All cram tests should use this. Make sure that "ag" runs the version
# of ag we just built, and make the output really simple.
alias ag="$TESTDIR/../ag --nocolor --noheading --unrestricted"