(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"diff hunk fusing">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: f body: (BraceGroup children: [ (C {(echo)} {($ VSub_Number "$1")}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(1)} spids:[27])] spids: [27] ) (While cond: [(C {(test)} {($ VSub_Name "$i")} {(-le)} {($ VSub_Number "$2")})] body: (DoGroup children: [ (C {(echo)} {($ VSub_Name "$i")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(expr)} {($ VSub_Name "$i")} {(Lit_Other "+")} {(1)}) ] ) left_token: <Left_CommandSub "$("> spids: [51 59] ) } spids: [50] ) ] spids: [50] ) ] spids: [42 62] ) ) (C {(echo)} {($ VSub_Number "$3")}) ] spids: [19] ) spids: [15 18] ) (FuncDef name: t body: (BraceGroup children: [ (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list: [{(4)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hunks) op: Equal rhs: {($ VSub_Number "$4")} spids: [89] ) ] spids: [89] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ("diff -U") ($ VSub_Number "$3"))} spids: [93] ) ] spids: [93] ) ] spids: [86 87 98 -1] ) (case_arm pat_list: [{(5)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hunks) op: Equal rhs: {($ VSub_Number "$5")} spids: [104] ) ] spids: [104] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: { (DQ ("diff -U") ($ VSub_Number "$3") (" --inter-hunk-context=") ($ VSub_Number "$4") ) } spids: [108] ) ] spids: [108] ) ] spids: [101 102 115 -1] ) ] spids: [79 83 118] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:label) op: Equal rhs: { (DQ ($ VSub_Name "$cmd") (", ") ($ VSub_Number "$1") (" common ") ($ VSub_Number "$2") ) } spids: [121] ) ] spids: [121] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(f) ($ VSub_Number "$1")} spids: [131] ) ] spids: [131] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:expected) op: Equal rhs: {(expected.) ($ VSub_Name "$file") (.) ($ VSub_Number "$3") (.) ($ VSub_Name "$hunks") } spids: [136] ) ] spids: [136] ) (If arms: [ (if_arm cond: [ (Pipeline children: [(C {(test)} {(-f)} {($ VSub_Name "$file")})] negated: True ) ] action: [ (SimpleCommand words: [{(f)} {(A)} {($ VSub_Number "$1")} {(B)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [168] ) ] ) (C {(git)} {(add)} {($ VSub_Name "$file")}) (C {(git)} {(commit)} {(-q)} {(-m.)} {($ VSub_Name "$file")}) (SimpleCommand words: [{(f)} {(X)} {($ VSub_Number "$1")} {(Y)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [198] ) ] ) ] spids: [-1 157] ) ] spids: [-1 202] ) (C {(test_expect_success)} {(DQ ($ VSub_Name "$label") (": count hunks (") ($ VSub_Name "$hunks") (")"))} { (DQ ("\n") ("\t\ttest ") (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {($ VSub_Name "$cmd")} {($ VSub_Name "$file")}) (C {(grep)} {(SQ <"^@@ ">)}) (C {(wc)} {(-l)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [218 238] ) (" = ") ($ VSub_Name "$hunks") ("\n") ("\t") ) } ) (AndOr children: [ (C {(test)} {(-f)} {($ VSub_Name "$expected")}) (C {(test_expect_success)} {(DQ ($ VSub_Name "$label") (": check output"))} { (DQ ("\n") ("\t\tgit ") ($ VSub_Name "$cmd") (" ") ($ VSub_Name "$file") (" | grep -v '^index ' >actual &&\n") ("\t\ttest_cmp ") ($ VSub_Name "$expected") (" actual\n") ("\t") ) } ) ] op_id: Op_DAmp ) ] spids: [76] ) spids: [72 75] ) (AndOr children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("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") ) } do_expansion: True here_end: EOF was_filled: True spids: [281] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(expected.f1.0.1)} spids:[284]) ] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("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") ) } do_expansion: True here_end: EOF was_filled: True spids: [305] ) (Redir op_id:Redir_Great fd:-1 arg_word:{(expected.f1.0.2)} spids:[308]) ] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) (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)}) ] )