(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:'diff --relative tests' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:17))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:21) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -m empty &&\n' span_id:22) (Token id:Id.Lit_Chars val:'\techo content >file1 &&\n' span_id:23) (Token id:Id.Lit_Chars val:'\tmkdir subdir &&\n' span_id:24) (Token id:Id.Lit_Chars val:'\techo other content >subdir/file2 &&\n' span_id:25) (Token id:Id.Lit_Chars val:'\tgit add . &&\n' span_id:26) (Token id:Id.Lit_Chars val:'\tgit commit -m one\n' span_id:27) ) } ) (command.ShFunction name: check_diff body: (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [37] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:39) ) (C {(shift)}) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:45) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:48) fd: -1 here_begin: {(EOF)} here_end_span_id: 65 stdin_parts: [ ('diff --git a/') ($ Id.VSub_DollarName '$expect') (' b/') ($ Id.VSub_DollarName '$expect') ('\n') ('new file mode 100644\n') ('index 0000000..25c05ef\n') ('--- /dev/null\n') ('+++ b/') ($ Id.VSub_DollarName '$expect') ('\n') ('@@ -0,0 +1 @@\n') ('+other content\n') ] ) ] ) (C {(test_expect_success)} {(DQ ('-p ') ($ Id.VSub_Star '$*'))} { (DQ ('\n') ('\tgit diff -p ') ($ Id.VSub_Star '$*') (' HEAD^ >actual &&\n') ('\ttest_cmp expected actual\n') ) } ) ] ) ) (command.ShFunction name: check_numstat body: (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [90] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:92) ) (C {(shift)}) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:98) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:101) fd: -1 here_begin: {(EOF)} here_end_span_id: 108 stdin_parts: [('1\t0\t') ($ Id.VSub_DollarName '$expect') ('\n')] ) ] ) (C {(test_expect_success)} {(DQ ('--numstat ') ($ Id.VSub_Star '$*'))} { (DQ ('\n') ("\techo '1\t0\t") ($ Id.VSub_DollarName '$expect') ("' >expected &&\n") ('\tgit diff --numstat ') ($ Id.VSub_Star '$*') (' HEAD^ >actual &&\n') ('\ttest_cmp expected actual\n') ) } ) ] ) ) (command.ShFunction name: check_stat body: (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [136] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:138) ) (C {(shift)}) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:144) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:147) fd: -1 here_begin: {(EOF)} here_end_span_id: 155 stdin_parts: [ (' ') ($ Id.VSub_DollarName '$expect') (' | 1 +\n') (' 1 file changed, 1 insertion(+)\n') ] ) ] ) (C {(test_expect_success)} {(DQ ('--stat ') ($ Id.VSub_Star '$*'))} { (DQ ('\n') ('\tgit diff --stat ') ($ Id.VSub_Star '$*') (' HEAD^ >actual &&\n') ('\ttest_i18ncmp expected actual\n') ) } ) ] ) ) (command.ShFunction name: check_raw body: (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [180] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:182) ) (C {(shift)}) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:188) fd: -1 arg_word: {(expected)} ) (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:191) fd: -1 here_begin: {(EOF)} here_end_span_id: 198 stdin_parts: [ ( ':000000 100644 0000000000000000000000000000000000000000 25c05ef3639d2d270e7fe765a67668f098092bc5 A\t' ) ($ Id.VSub_DollarName '$expect') ('\n') ] ) ] ) (C {(test_expect_success)} {(DQ ('--raw ') ($ Id.VSub_Star '$*'))} { (DQ ('\n') ('\tgit diff --no-abbrev --raw ') ($ Id.VSub_Star '$*') (' HEAD^ >actual &&\n') ('\ttest_cmp expected actual\n') ) } ) ] ) ) (command.ForEach iter_name: type iter_words: [{(diff)} {(numstat)} {(stat)} {(raw)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(check_) ($ Id.VSub_DollarName '$type')} {(file2)} {(--relative) (Id.Lit_Equals '=') (subdir/)} ) (C {(check_) ($ Id.VSub_DollarName '$type')} {(file2)} {(--relative) (Id.Lit_Equals '=') (subdir)} ) (C {(check_) ($ Id.VSub_DollarName '$type')} {(dir/file2)} {(--relative) (Id.Lit_Equals '=') (sub)} ) ] ) ) (C {(test_done)}) ] )