diff options
Diffstat (limited to 't/t3002-ls-files-dashpath.sh')
-rwxr-xr-x | t/t3002-ls-files-dashpath.sh | 86 |
1 files changed, 46 insertions, 40 deletions
diff --git a/t/t3002-ls-files-dashpath.sh b/t/t3002-ls-files-dashpath.sh index 54d22a4..4dd2455 100755 --- a/t/t3002-ls-files-dashpath.sh +++ b/t/t3002-ls-files-dashpath.sh @@ -16,56 +16,62 @@ filesystem. TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh -test_expect_success \ - setup \ - 'echo frotz >path0 && +test_expect_success 'setup' ' + echo frotz >path0 && echo frotz >./-foo && - echo frotz >./--' + echo frotz >./-- +' -test_expect_success \ - 'git ls-files without path restriction.' \ - 'git ls-files --others >output && - test_cmp output - <<EOF --- --foo -output -path0 -EOF +test_expect_success 'git ls-files without path restriction.' ' + test_when_finished "rm -f expect" && + git ls-files --others >output && + cat >expect <<-\EOF && + -- + -foo + output + path0 + EOF + test_cmp output expect ' -test_expect_success \ - 'git ls-files with path restriction.' \ - 'git ls-files --others path0 >output && - test_cmp output - <<EOF -path0 -EOF +test_expect_success 'git ls-files with path restriction.' ' + test_when_finished "rm -f expect" && + git ls-files --others path0 >output && + cat >expect <<-\EOF && + path0 + EOF + test_cmp output expect ' -test_expect_success \ - 'git ls-files with path restriction with --.' \ - 'git ls-files --others -- path0 >output && - test_cmp output - <<EOF -path0 -EOF +test_expect_success 'git ls-files with path restriction with --.' ' + test_when_finished "rm -f expect" && + git ls-files --others -- path0 >output && + cat >expect <<-\EOF && + path0 + EOF + test_cmp output expect ' -test_expect_success \ - 'git ls-files with path restriction with -- --.' \ - 'git ls-files --others -- -- >output && - test_cmp output - <<EOF --- -EOF +test_expect_success 'git ls-files with path restriction with -- --.' ' + test_when_finished "rm -f expect" && + git ls-files --others -- -- >output && + cat >expect <<-\EOF && + -- + EOF + test_cmp output expect ' -test_expect_success \ - 'git ls-files with no path restriction.' \ - 'git ls-files --others -- >output && - test_cmp output - <<EOF --- --foo -output -path0 -EOF +test_expect_success 'git ls-files with no path restriction.' ' + test_when_finished "rm -f expect" && + git ls-files --others -- >output && + cat >expect <<-\EOF && + -- + -foo + output + path0 + EOF + test_cmp output expect + ' test_done |