(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 hunk fusing' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShFunction name: f body: (command.BraceGroup children: [ (C {(echo)} {($ Id.VSub_Number '$1')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: {(1)} spids: [27] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:31) cond: [(C {(test)} {($ Id.VSub_DollarName '$i')} {(-le)} {($ Id.VSub_Number '$2')})] body: (command.DoGroup children: [ (C {(echo)} {($ Id.VSub_DollarName '$i')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:51) command_list: (command.CommandList children: [ (C {(expr)} {($ Id.VSub_DollarName '$i')} {(Id.Lit_Other '+')} {(1)} ) ] ) ) } spids: [50] ) ] ) ] ) ) (C {(echo)} {($ Id.VSub_Number '$3')}) ] ) ) (command.ShFunction name: t body: (command.BraceGroup children: [ (command.Case to_match: {($ Id.VSub_Pound '$#')} arms: [ (case_arm pat_list: [{(4)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:hunks) op: assign_op.Equal rhs: {($ Id.VSub_Number '$4')} spids: [89] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:91) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: {(DQ ('diff -U') ($ Id.VSub_Number '$3'))} spids: [93] ) ] ) ] spids: [86 87 98 -1] ) (case_arm pat_list: [{(5)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:hunks) op: assign_op.Equal rhs: {($ Id.VSub_Number '$5')} spids: [104] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:106) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:cmd) op: assign_op.Equal rhs: { (DQ ('diff -U') ($ Id.VSub_Number '$3') (' --inter-hunk-context=') ($ Id.VSub_Number '$4') ) } spids: [108] ) ] ) ] spids: [101 102 115 -1] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:label) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$cmd') (', ') ($ Id.VSub_Number '$1') (' common ') ($ Id.VSub_Number '$2') ) } spids: [121] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: {(f) ($ Id.VSub_Number '$1')} spids: [131] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expected) op: assign_op.Equal rhs: {(expected.) ($ Id.VSub_DollarName '$file') (.) ($ Id.VSub_Number '$3') (.) ($ Id.VSub_DollarName '$hunks') } spids: [136] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Pipeline children: [(C {(test)} {(-f)} {($ Id.VSub_DollarName '$file')})] negated: T ) ] action: [ (command.Simple words: [{(f)} {(A)} {($ Id.VSub_Number '$1')} {(B)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:168) fd: -1 arg_word: {($ Id.VSub_DollarName '$file')} ) ] ) (C {(git)} {(add)} {($ Id.VSub_DollarName '$file')}) (C {(git)} {(commit)} {(-q)} {(-m.)} {($ Id.VSub_DollarName '$file')}) (command.Simple words: [{(f)} {(X)} {($ Id.VSub_Number '$1')} {(Y)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:198) fd: -1 arg_word: {($ Id.VSub_DollarName '$file')} ) ] ) ] spids: [146 157] ) ] ) (C {(test_expect_success)} { (DQ ($ Id.VSub_DollarName '$label') (': count hunks (') ($ Id.VSub_DollarName '$hunks') (')') ) } { (DQ ('\n') ('\t\ttest ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:218) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(git)} {($ Id.VSub_DollarName '$cmd')} {($ Id.VSub_DollarName '$file')} ) (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:'^@@ ' span_id:230))}) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) (' = ') ($ Id.VSub_DollarName '$hunks') ('\n') ('\t') ) } ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(test)} {(-f)} {($ Id.VSub_DollarName '$expected')}) (C {(test_expect_success)} {(DQ ($ Id.VSub_DollarName '$label') (': check output'))} { (DQ ('\n') ('\t\tgit ') ($ Id.VSub_DollarName '$cmd') (' ') ($ Id.VSub_DollarName '$file') (" | grep -v '^index ' >actual &&\n") ('\t\ttest_cmp ') ($ Id.VSub_DollarName '$expected') (' actual\n') ('\t') ) } ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:281) fd: -1 here_begin: {(EOF)} here_end_span_id: 303 stdin_parts: [ ('diff --git a/f1 b/f1\n') ('--- a/f1\n') ('+++ b/f1\n') ('@@ -1,3 +1,3 @@\n') ('-A\n') ('+X\n') (' 1\n') ('-B\n') ('+Y\n') ] ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:284) fd: -1 arg_word: {(expected.f1.0.1)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:289) arg_word: {(1)} ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cat)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:307) fd: -1 here_begin: {(EOF)} here_end_span_id: 329 stdin_parts: [ ('diff --git a/f1 b/f1\n') ('--- a/f1\n') ('+++ b/f1\n') ('@@ -1 +1 @@\n') ('-A\n') ('+X\n') ('@@ -3 +3 @@ A\n') ('-B\n') ('+Y\n') ] ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:310) fd: -1 arg_word: {(expected.f1.0.2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:315) arg_word: {(1)} ) ] ) (C {(t)} {(1)} {(line)} {(0)} {(2)}) (C {(t)} {(1)} {(line)} {(0)} {(0)} {(2)}) (C {(t)} {(1)} {(line)} {(0)} {(1)} {(1)}) (C {(t)} {(1)} {(line)} {(0)} {(2)} {(1)}) (C {(t)} {(1)} {(line)} {(1)} {(1)}) (C {(t)} {(2)} {(lines)} {(0)} {(2)}) (C {(t)} {(2)} {(lines)} {(0)} {(0)} {(2)}) (C {(t)} {(2)} {(lines)} {(0)} {(1)} {(2)}) (C {(t)} {(2)} {(lines)} {(0)} {(2)} {(1)}) (C {(t)} {(2)} {(lines)} {(1)} {(1)}) (C {(t)} {(3)} {(lines)} {(1)} {(2)}) (C {(t)} {(3)} {(lines)} {(1)} {(0)} {(2)}) (C {(t)} {(3)} {(lines)} {(1)} {(1)} {(1)}) (C {(t)} {(3)} {(lines)} {(1)} {(2)} {(1)}) (C {(t)} {(9)} {(lines)} {(3)} {(2)}) (C {(t)} {(9)} {(lines)} {(3)} {(2)} {(2)}) (C {(t)} {(9)} {(lines)} {(3)} {(3)} {(1)}) (C {(test_done)}) ] )