Skip to content

Commit

Permalink
A very simple "make test" that uses cram and contains one test, based on
Browse files Browse the repository at this point in the history
the fine work by @sjl a year ago. To use:

$ sudo easy_install cram
$ ./build.sh
$ make test
  • Loading branch information
gurgeous committed Jan 2, 2014
1 parent 1b20368 commit ffb764b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -22,4 +22,5 @@ Makefile.in
missing
src/config.h*
stamp-h1
tests/*.err
the_silver_searcher.spec
3 changes: 3 additions & 0 deletions Makefile.am
Expand Up @@ -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 changes: 24 additions & 0 deletions tests/case_sensitivity.t
@@ -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 changes: 4 additions & 0 deletions tests/setup.sh
@@ -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"

0 comments on commit ffb764b

Please sign in to comment.