Skip to content

Commit e1f8fb9

Browse files
committed
Add a test for exclusions
1 parent a476198 commit e1f8fb9

10 files changed

+100
-0
lines changed

tests/exclusions.vim

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
3+
" TODO: ensure that the configuration is already set
4+
5+
let g:EasyGrepMode=0
6+
7+
" Load the test data.
8+
cd allext/
9+
edit alphabet.a
10+
11+
let EasyGrepFilesToExclude="*.b,*.c"
12+
ResultListTag GrepAdd a (exclude b c)
13+
GrepAdd a
14+
ResultListTag GrepAdd A (exclude b c)
15+
GrepAdd A
16+
let EasyGrepFilesToExclude="*.a,*.c"
17+
ResultListTag GrepAdd b (exclude a c)
18+
GrepAdd b
19+
ResultListTag GrepAdd B (exclude a c)
20+
GrepAdd B
21+
let EasyGrepFilesToExclude="*.a,*.b"
22+
ResultListTag GrepAdd c (exclude a b)
23+
GrepAdd c
24+
ResultListTag GrepAdd C (exclude a b)
25+
GrepAdd C
26+
27+
cclose
28+
cd ../
29+
exe "ResultListSave ".testname.".out"
30+
quit!
31+
32+

tests/exclusions_ack.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_ack"
3+
GrepProgram ack
4+
5+
source exclusions.vim
6+

tests/exclusions_ag.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_ag"
3+
GrepProgram ag
4+
5+
source exclusions.vim
6+

tests/exclusions_findstr.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_findstr"
3+
GrepProgram findstr
4+
5+
source exclusions.vim
6+

tests/exclusions_grep.ok

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
allext\alphabet.a|1 col 1| GrepAdd a (exclude b c)
2+
allext\alphabet.a|1 col 0| a
3+
allext\alphabet.a|1 col 1| GrepAdd A (exclude b c)
4+
allext\alphabet.a|27 col 0| A
5+
allext\alphabet.a|1 col 1| GrepAdd b (exclude a c)
6+
allext\alphabet.b|2 col 0| b
7+
allext\alphabet.a|1 col 1| GrepAdd B (exclude a c)
8+
allext\alphabet.b|28 col 0| B
9+
allext\alphabet.a|1 col 1| GrepAdd c (exclude a b)
10+
allext\alphabet.c|3 col 0| c
11+
allext\alphabet.a|1 col 1| GrepAdd C (exclude a b)
12+
allext\alphabet.c|29 col 0| C

tests/exclusions_grep.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_grep"
3+
GrepProgram grep
4+
5+
source exclusions.vim
6+

tests/exclusions_pt.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_pt"
3+
GrepProgram pt
4+
5+
source exclusions.vim
6+

tests/exclusions_vimgrep.ok

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
allext\alphabet.a|1 col 1| GrepAdd a (exclude b c)
2+
allext\alphabet.a|1 col 1| a
3+
allext\alphabet.a|1 col 1| GrepAdd A (exclude b c)
4+
allext\alphabet.a|27 col 1| A
5+
allext\alphabet.a|1 col 1| GrepAdd b (exclude a c)
6+
allext\alphabet.b|2 col 1| b
7+
allext\alphabet.a|1 col 1| GrepAdd B (exclude a c)
8+
allext\alphabet.b|28 col 1| B
9+
allext\alphabet.a|1 col 1| GrepAdd c (exclude a b)
10+
allext\alphabet.c|3 col 1| c
11+
allext\alphabet.a|1 col 1| GrepAdd C (exclude a b)
12+
allext\alphabet.c|29 col 1| C

tests/exclusions_vimgrep.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
let testname="exclusions_vimgrep"
3+
GrepProgram vimgrep
4+
5+
source exclusions.vim
6+

tests/vimgrep.suite

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ wholeword_grep.vim
1515
wholeword_pt.vim
1616
wholeword_vimgrep.vim
1717

18+
# wholeword
19+
exclusions_ack.vim
20+
exclusions_ag.vim
21+
# exclusions_findstr.vim # not yet supported
22+
exclusions_grep.vim
23+
# exclusions_pt.vim # not yet supported
24+
exclusions_vimgrep.vim
25+

0 commit comments

Comments
 (0)