3 test_description
='Test parse_pathspec_file()'
7 test_expect_success
'one item from stdin' '
13 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
15 test_cmp expect actual
18 test_expect_success
'one item from file' '
19 cat >expect <<-\EOF &&
24 test-tool parse-pathspec-file --pathspec-from-file=list >actual &&
26 test_cmp expect actual
29 test_expect_success
'NUL delimiters' '
30 cat >expect <<-\EOF &&
35 printf "fileA.t\0fileB.t\0" |
36 test-tool parse-pathspec-file --pathspec-from-file=- --pathspec-file-nul >actual &&
38 test_cmp expect actual
41 test_expect_success
'LF delimiters' '
42 cat >expect <<-\EOF &&
47 printf "fileA.t\nfileB.t\n" |
48 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
50 test_cmp expect actual
53 test_expect_success
'no trailing delimiter' '
54 cat >expect <<-\EOF &&
59 printf "fileA.t\nfileB.t" |
60 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
62 test_cmp expect actual
65 test_expect_success
'CRLF delimiters' '
66 cat >expect <<-\EOF &&
71 printf "fileA.t\r\nfileB.t\r\n" |
72 test-tool parse-pathspec-file --pathspec-from-file=- >actual &&
74 test_cmp expect actual
77 test_expect_success
'quotes' '
78 cat >expect <<-\EOF &&
86 test-tool parse-pathspec-file --pathspec-from-file=list >actual &&
88 test_cmp expect actual
91 test_expect_success
'--pathspec-file-nul takes quotes literally' '
92 # Note: there is an extra newline because --pathspec-file-nul takes
93 # input \n literally, too
94 cat >expect <<-\EOF &&
103 test-tool parse-pathspec-file --pathspec-from-file=list --pathspec-file-nul >actual &&
105 test_cmp expect actual