diff options
Diffstat (limited to 't/t4211-line-log.sh')
| -rwxr-xr-x | t/t4211-line-log.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index ac9e4d0928..02d76dca28 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -19,7 +19,7 @@ test_expect_success 'basic command line parsing' ' # -L requires there is no pathspec test_must_fail git log -L1,1:b.c -- b.c 2>error && - test_i18ngrep "cannot be used with pathspec" error && + test_grep "cannot be used with pathspec" error && # This would fail because --follow wants a single path, but # we may fail due to incompatibility between -L/--follow in @@ -50,7 +50,7 @@ canned_test_failure () { test_bad_opts () { test_expect_success "invalid args: $1" " test_must_fail git log $1 2>errors && - test_i18ngrep '$2' errors + test_grep '$2' errors " } @@ -315,4 +315,26 @@ test_expect_success 'line-log with --before' ' test_cmp expect actual ' +test_expect_success 'setup tests for zero-width regular expressions' ' + cat >expect <<-EOF + Modify func1() in file.c + Add func1() and func2() in file.c + EOF +' + +test_expect_success 'zero-width regex $ matches any function name' ' + git log --format="%s" --no-patch "-L:$:file.c" >actual && + test_cmp expect actual +' + +test_expect_success 'zero-width regex ^ matches any function name' ' + git log --format="%s" --no-patch "-L:^:file.c" >actual && + test_cmp expect actual +' + +test_expect_success 'zero-width regex .* matches any function name' ' + git log --format="%s" --no-patch "-L:.*:file.c" >actual && + test_cmp expect actual +' + test_done |
