File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ grep_notes() {
27
27
return 1
28
28
fi
29
29
30
- grep_output=$( grep -r " $notes_dir " -l -e " $* " 2>&1 )
30
+ grep_output=$( grep -r " $notes_dir " -li -e " $* " 2>&1 )
31
31
grep_result=$?
32
32
formatted_output=$( printf " $grep_output " | without_notes_dir)
33
33
Original file line number Diff line number Diff line change @@ -22,12 +22,21 @@ notes="./notes"
22
22
}
23
23
24
24
@test " Should match only the files containing the given pattern when grepping" {
25
- echo " my-pattern" > $NOTES_DIRECTORY /matching-node .md
26
- echo " some-other-pattern" > $NOTES_DIRECTORY /non-matching-node .md
25
+ echo " my-pattern" > $NOTES_DIRECTORY /matching-note .md
26
+ echo " some-other-pattern" > $NOTES_DIRECTORY /non-matching-note .md
27
27
28
28
run $notes grep my-pattern
29
29
30
30
assert_success
31
- assert_line " matching-node.md"
32
- refute_line " non-matching-node.md"
31
+ assert_line " matching-note.md"
32
+ refute_line " non-matching-note.md"
33
+ }
34
+
35
+ @test " Should grep case-insensitively" {
36
+ echo " LETTERS" > $NOTES_DIRECTORY /matching-note.md
37
+
38
+ run $notes grep letter
39
+
40
+ assert_success
41
+ assert_line " matching-note.md"
33
42
}
You can’t perform that action at this time.
0 commit comments