(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'apply same filename' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:18))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:22) (Token id:Id.Lit_Chars val:'\n' span_id:23) (Token id:Id.Lit_Chars val:'\tmkdir -p some/sub/dir &&\n' span_id:24) (Token id:Id.Lit_Chars val:'\techo Hello > some/sub/dir/file &&\n' span_id:25) (Token id:Id.Lit_Chars val:'\tgit add some/sub/dir/file &&\n' span_id:26) (Token id:Id.Lit_Chars val:'\tgit commit -m initial &&\n' span_id:27) (Token id:Id.Lit_Chars val:'\tgit tag initial\n' span_id:28) (Token id:Id.Lit_Chars val:'\n' span_id:29) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:35) fd:-1 arg_word:{(patch)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:39) fd: -1 here_begin: {(EOF)} here_end_span_id: 50 stdin_parts: [ ('diff a/bla/blub/dir/file b/bla/blub/dir/file\n') ('--- a/bla/blub/dir/file\n') ('+++ b/bla/blub/dir/file\n') ('@@ -1,1 +1,1 @@\n') ('-Hello\n') ('+Bello\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory -p (1)' span_id:55))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:59) (Token id:Id.Lit_Chars val:'\n' span_id:60) (Token id: Id.Lit_Chars val: '\tgit apply --directory=some/sub -p3 --index patch &&\n' span_id: 61 ) (Token id:Id.Lit_Chars val:'\ttest Bello = $(git show :some/sub/dir/file) &&\n' span_id:62) (Token id: Id.Lit_Chars val: '\ttest Bello = $(cat some/sub/dir/file)\n' span_id: 63 ) (Token id:Id.Lit_Chars val:'\n' span_id:64) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory -p (2) ' span_id:71))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:75) (Token id:Id.Lit_Chars val:'\n' span_id:76) (Token id:Id.Lit_Chars val:'\tgit reset --hard initial &&\n' span_id:77) (Token id:Id.Lit_Chars val:'\tgit apply --directory=some/sub/ -p3 --index patch &&\n' span_id:78) (Token id: Id.Lit_Chars val: '\ttest Bello = $(git show :some/sub/dir/file) &&\n' span_id: 79 ) (Token id:Id.Lit_Chars val:'\ttest Bello = $(cat some/sub/dir/file)\n' span_id:80) (Token id:Id.Lit_Chars val:'\n' span_id:81) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:87) fd:-1 arg_word:{(patch)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:91) fd: -1 here_begin: {(EOF)} here_end_span_id: 103 stdin_parts: [ ('diff --git a/newfile b/newfile\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ b/newfile\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory (new file)' span_id:108))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:112) (Token id:Id.Lit_Chars val:'\tgit reset --hard initial &&\n' span_id:113) (Token id:Id.Lit_Chars val:'\tgit apply --directory=some/sub/dir/ --index patch &&\n' span_id:114) (Token id: Id.Lit_Chars val: '\ttest content = $(git show :some/sub/dir/newfile) &&\n' span_id: 115 ) (Token id:Id.Lit_Chars val:'\ttest content = $(cat some/sub/dir/newfile)\n' span_id:116) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:122) fd:-1 arg_word:{(patch)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:126) fd: -1 here_begin: {(EOF)} here_end_span_id: 138 stdin_parts: [ ('diff --git a/c/newfile2 b/c/newfile2\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ b/c/newfile2\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory -p (new file)' span_id:143))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:147) (Token id:Id.Lit_Chars val:'\tgit reset --hard initial &&\n' span_id:148) (Token id: Id.Lit_Chars val: '\tgit apply -p2 --directory=some/sub/dir/ --index patch &&\n' span_id: 149 ) (Token id:Id.Lit_Chars val:'\ttest content = $(git show :some/sub/dir/newfile2) &&\n' span_id:150) (Token id: Id.Lit_Chars val: '\ttest content = $(cat some/sub/dir/newfile2)\n' span_id: 151 ) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:157) fd:-1 arg_word:{(patch)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:161) fd: -1 here_begin: {(EOF)} here_end_span_id: 173 stdin_parts: [ ('diff --git a/delfile b/delfile\n') ('deleted file mode 100644\n') ('index d95f3ad..0000000\n') ('--- a/delfile\n') ('+++ /dev/null\n') ('@@ -1 +0,0 @@\n') ('-content\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory (delete file)' span_id:178))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:182) (Token id:Id.Lit_Chars val:'\tgit reset --hard initial &&\n' span_id:183) (Token id:Id.Lit_Chars val:'\techo content >some/sub/dir/delfile &&\n' span_id:184) (Token id:Id.Lit_Chars val:'\tgit add some/sub/dir/delfile &&\n' span_id:185) (Token id:Id.Lit_Chars val:'\tgit apply --directory=some/sub/dir/ --index patch &&\n' span_id:186) (Token id:Id.Lit_Chars val:'\t! (git ls-files | grep delfile)\n' span_id:187) ) } ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:193) fd:-1 arg_word:{(patch)}) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:197) fd: -1 here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:200))} here_end_span_id: 210 stdin_parts: [ ('diff --git "a/qu\\157tefile" "b/qu\\157tefile"\n') ('new file mode 100644\n') ('index 0000000..d95f3ad\n') ('--- /dev/null\n') ('+++ "b/qu\\157tefile"\n') ('@@ -0,0 +1 @@\n') ('+content\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'apply --directory (quoted filename)' span_id:215))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:219) (Token id:Id.Lit_Chars val:'\tgit reset --hard initial &&\n' span_id:220) (Token id:Id.Lit_Chars val:'\tgit apply --directory=some/sub/dir/ --index patch &&\n' span_id:221) (Token id: Id.Lit_Chars val: '\ttest content = $(git show :some/sub/dir/quotefile) &&\n' span_id: 222 ) (Token id:Id.Lit_Chars val:'\ttest content = $(cat some/sub/dir/quotefile)\n' span_id:223) ) } ) (C {(test_done)}) ] )