Skip to content

Commit

Permalink
Merge pull request #894 from cemeyer/fbsd-filetype.t
Browse files Browse the repository at this point in the history
Fix #893 - Use [ \t] instead of \s (BSD grep)
  • Loading branch information
ggreer committed May 9, 2016
2 parents 9fc8924 + b8f9c68 commit 0c55a13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/filetype.t
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Setup:

$ . $TESTDIR/setup.sh
$ TEST_FILETYPE_EXT1=`ag --list-file-types | grep -E '^\s+\..+' | head -n 1 | awk '{ print $1 }'`
$ TEST_FILETYPE_EXT2=`ag --list-file-types | grep -E '^\s+\..+' | tail -n 1 | awk '{ print $1 }'`
$ TEST_FILETYPE_EXT1=`ag --list-file-types | grep -E '^[ \t]+\..+' | head -n 1 | awk '{ print $1 }'`
$ TEST_FILETYPE_EXT2=`ag --list-file-types | grep -E '^[ \t]+\..+' | tail -n 1 | awk '{ print $1 }'`
$ TEST_FILETYPE_DIR=filetype_test
$ mkdir $TEST_FILETYPE_DIR
$ printf "This is filetype test1.\n" > $TEST_FILETYPE_DIR/test.$TEST_FILETYPE_EXT1
$ printf "This is filetype test2.\n" > $TEST_FILETYPE_DIR/test.$TEST_FILETYPE_EXT2

Match only top file type:

$ TEST_FILETYPE_OPTION=`ag --list-file-types | grep -E '^\s+--.+' | head -n 1 | awk '{ print $1 }'`
$ TEST_FILETYPE_OPTION=`ag --list-file-types | grep -E '^[ \t]+--.+' | head -n 1 | awk '{ print $1 }'`
$ ag 'This is filetype test' --nofilename $TEST_FILETYPE_OPTION $TEST_FILETYPE_DIR
This is filetype test1.

0 comments on commit 0c55a13

Please sign in to comment.