3 test_description
='Test parse_pathspec_file()'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'one item from stdin' '
14 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
16 test_cmp expect actual
19 test_expect_success
'one item from file' '
20 cat >expect <<-\EOF &&
25 test-tool parse-pathspec-file --pathspec-from-file=list >actual &&
27 test_cmp expect actual
30 test_expect_success
'NUL delimiters' '
31 cat >expect <<-\EOF &&
36 printf "fileA.t\0fileB.t\0" |
37 test-tool parse-pathspec-file --pathspec-from-file=- --pathspec-file-nul >actual &&
39 test_cmp expect actual
42 test_expect_success
'LF delimiters' '
43 cat >expect <<-\EOF &&
48 printf "fileA.t\nfileB.t\n" |
49 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
51 test_cmp expect actual
54 test_expect_success
'no trailing delimiter' '
55 cat >expect <<-\EOF &&
60 printf "fileA.t\nfileB.t" |
61 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
63 test_cmp expect actual
66 test_expect_success
'CRLF delimiters' '
67 cat >expect <<-\EOF &&
72 printf "fileA.t\r\nfileB.t\r\n" |
73 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
75 test_cmp expect actual
78 test_expect_success
'quotes' '
79 cat >expect <<-\EOF &&
87 test-tool parse-pathspec-file --pathspec-from-file=list >actual &&
89 test_cmp expect actual
92 test_expect_success
'--pathspec-file-nul takes quotes literally' '
93 # Note: there is an extra newline because --pathspec-file-nul takes
94 # input \n literally, too
95 cat >expect <<-\EOF &&
104 test-tool parse-pathspec-file --pathspec-from-file=list --pathspec-file-nul >actual &&
106 test_cmp expect actual