(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[12]) op: Equal rhs: {(SQ <'common tail optimization'>)} spids: [12] ) ] spids: [12] ) (C {(.)} {(./test-lib.sh)}) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z spids:[23]) op: Equal rhs: {(zzzzzzzz)} spids: [23] ) ] spids: [23] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z spids:[30]) op: Equal rhs: { (DQ ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ) } spids: [30] ) ] spids: [30] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z spids:[46]) op: Equal rhs: { (DQ ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ) } spids: [46] ) ] spids: [46] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z spids:[62]) op: Equal rhs: {(DQ ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z') ($ VSub_Name '$z'))} spids: [62] ) ] spids: [62] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z2047 spids:[74]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(expr)} {(DQ ($ VSub_Name '$z'))} {(Lit_Other ':')} {(SQ <'.\\(.*\\)'>)}) ] ) left_token: <Left_CommandSub '$('> spids: [75 87] ) } spids: [74] ) ] spids: [74] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:x spids:[95]) op: Equal rhs: {(zzzzzzzzzz)} spids: [95] ) ] spids: [95] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:y spids:[102]) op: Equal rhs: { (DQ ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ($ VSub_Name '$x') ) } spids: [102] ) ] spids: [102] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z spids:[120]) op: Equal rhs: { (DQ ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ($ VSub_Name '$y') ) } spids: [120] ) ] spids: [120] ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z1000 spids:[138]) op: Equal rhs: {($ VSub_Name '$z')} spids: [138] ) ] spids: [138] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z100 spids:[141]) op: Equal rhs: {($ VSub_Name '$y')} spids: [141] ) ] spids: [141] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:z10 spids:[144]) op: Equal rhs: {($ VSub_Name '$x')} spids: [144] ) ] spids: [144] ) (command.FuncDef name: zs body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[155]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [155] ) ] spids: [155] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {(DQ ($ VSub_Name '$count'))} {(-ge)} {(1000)})] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[177]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1000)}) ) spids: [178 185] ) } spids: [177] ) ] spids: [177] ) (C {(printf)} {(DQ ('%s'))} {($ VSub_Name '$z1000')}) ] spids: [174 197] ) ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {(DQ ($ VSub_Name '$count'))} {(-ge)} {(100)})] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[216]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) right: (arith_expr.ArithWord w:{(Lit_Digits 100)}) ) spids: [217 224] ) } spids: [216] ) ] spids: [216] ) (C {(printf)} {(DQ ('%s'))} {($ VSub_Name '$z100')}) ] spids: [213 236] ) ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {(DQ ($ VSub_Name '$count'))} {(-ge)} {(10)})] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[255]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) right: (arith_expr.ArithWord w:{(Lit_Digits 10)}) ) spids: [256 263] ) } spids: [255] ) ] spids: [255] ) (C {(printf)} {(DQ ('%s'))} {($ VSub_Name '$z10')}) ] spids: [252 275] ) ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {(DQ ($ VSub_Name '$count'))} {(-ge)} {(1)})] body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:count spids:[294]) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_Name '$count')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [295 302] ) } spids: [294] ) ] spids: [294] ) (C {(printf)} {(DQ (z))}) ] spids: [291 312] ) ) ] spids: [152] ) spids: [148 151] ) (command.FuncDef name: zc body: (command.BraceGroup children: [ (command.Sentence child: (C {(sed)} {(-e)} {(DQ ('/^index/d'))} {(-e)} {(DQ (s/) ($ VSub_Name '$z1000') (/Q/g))} {(-e)} {(DQ (s/QQQQQQQQQ/Z9000/g))} {(-e)} {(DQ (s/QQQQQQQQ/Z8000/g))} {(-e)} {(DQ (s/QQQQQQQ/Z7000/g))} {(-e)} {(DQ (s/QQQQQQ/Z6000/g))} {(-e)} {(DQ (s/QQQQQ/Z5000/g))} {(-e)} {(DQ (s/QQQQ/Z4000/g))} {(-e)} {(DQ (s/QQQ/Z3000/g))} {(-e)} {(DQ (s/QQ/Z2000/g))} {(-e)} {(DQ (s/Q/Z1000/g))} {(-e)} {(DQ (s/) ($ VSub_Name '$z100') (/Q/g))} {(-e)} {(DQ (s/QQQQQQQQQ/Z900/g))} {(-e)} {(DQ (s/QQQQQQQQ/Z800/g))} {(-e)} {(DQ (s/QQQQQQQ/Z700/g))} {(-e)} {(DQ (s/QQQQQQ/Z600/g))} {(-e)} {(DQ (s/QQQQQ/Z500/g))} {(-e)} {(DQ (s/QQQQ/Z400/g))} {(-e)} {(DQ (s/QQQ/Z300/g))} {(-e)} {(DQ (s/QQ/Z200/g))} {(-e)} {(DQ (s/Q/Z100/g))} {(-e)} {(DQ (s/000Z//g))} {(-e)} {(DQ (s/) ($ VSub_Name '$z10') (/Q/g))} {(-e)} {(DQ (s/QQQQQQQQQ/Z90/g))} {(-e)} {(DQ (s/QQQQQQQQ/Z80/g))} {(-e)} {(DQ (s/QQQQQQQ/Z70/g))} {(-e)} {(DQ (s/QQQQQQ/Z60/g))} {(-e)} {(DQ (s/QQQQQ/Z50/g))} {(-e)} {(DQ (s/QQQQ/Z40/g))} {(-e)} {(DQ (s/QQQ/Z30/g))} {(-e)} {(DQ (s/QQ/Z20/g))} {(-e)} {(DQ (s/Q/Z10/g))} {(-e)} {(DQ (s/00Z//g))} {(-e)} {(DQ (s/z/Q/g))} {(-e)} {(DQ (s/QQQQQQQQQ/Z9/g))} {(-e)} {(DQ (s/QQQQQQQQ/Z8/g))} {(-e)} {(DQ (s/QQQQQQQ/Z7/g))} {(-e)} {(DQ (s/QQQQQQ/Z6/g))} {(-e)} {(DQ (s/QQQQQ/Z5/g))} {(-e)} {(DQ (s/QQQQ/Z4/g))} {(-e)} {(DQ (s/QQQ/Z3/g))} {(-e)} {(DQ (s/QQ/Z2/g))} {(-e)} {(DQ (s/Q/Z1/g))} {(-e)} {(DQ (s/0Z//g))} ) terminator: <Op_Semi ';'> ) ] spids: [322] ) spids: [317 321] ) (command.FuncDef name: expect_pattern body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cnt spids:[698]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [698] ) ] spids: [698] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 782 stdin_parts: [ ('diff --git a/file-a') ($ VSub_Name '$cnt') (' b/file-a') ($ VSub_Name '$cnt') ('\n') ('--- a/file-a') ($ VSub_Name '$cnt') ('\n') ('+++ b/file-a') ($ VSub_Name '$cnt') ('\n') ('@@ -1 +1 @@\n') (-Z) (${ VSub_Name cnt) ('a\n') ('+Z') (${ VSub_Name cnt) ('A\n') ('diff --git a/file-b') ($ VSub_Name '$cnt') (' b/file-b') ($ VSub_Name '$cnt') ('\n') ('--- a/file-b') ($ VSub_Name '$cnt') ('\n') ('+++ b/file-b') ($ VSub_Name '$cnt') ('\n') ('@@ -1 +1 @@\n') ('-b\n') ('+B\n') ('diff --git a/file-c') ($ VSub_Name '$cnt') (' b/file-c') ($ VSub_Name '$cnt') ('\n') ('--- a/file-c') ($ VSub_Name '$cnt') ('\n') ('+++ b/file-c') ($ VSub_Name '$cnt') ('\n') ('@@ -1 +1 @@\n') (-cZ) ($ VSub_Name '$cnt') ('\n') (Lit_Other '\\') (' No newline at end of file\n') ('+CZ') ($ VSub_Name '$cnt') ('\n') (Lit_Other '\\') (' No newline at end of file\n') ('diff --git a/file-d') ($ VSub_Name '$cnt') (' b/file-d') ($ VSub_Name '$cnt') ('\n') ('--- a/file-d') ($ VSub_Name '$cnt') ('\n') ('+++ b/file-d') ($ VSub_Name '$cnt') ('\n') ('@@ -1 +1 @@\n') ('-d\n') ('+D\n') ] ) ] ) ] spids: [695] ) spids: [690 694] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:sample spids:[786]) op: Equal rhs: {(SQ <'1023 1024 1025 2047 4095'>)} spids: [786] ) ] spids: [786] ) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\n'> <'\tfor n in $sample\n'> <'\tdo\n'> <'\t\t( zs $n ; echo a ) >file-a$n &&\n'> <'\t\t( echo b; zs $n; echo ) >file-b$n &&\n'> <'\t\t( printf c; zs $n ) >file-c$n &&\n'> <'\t\t( echo d; zs $n ) >file-d$n &&\n'> <'\n'> <'\t\tgit add file-a$n file-b$n file-c$n file-d$n &&\n'> <'\n'> <'\t\t( zs $n ; echo A ) >file-a$n &&\n'> <'\t\t( echo B; zs $n; echo ) >file-b$n &&\n'> <'\t\t( printf C; zs $n ) >file-c$n &&\n'> <'\t\t( echo D; zs $n ) >file-d$n &&\n'> <'\n'> <'\t\texpect_pattern $n || return 1\n'> <'\n'> <'\tdone >expect\n'> ) } ) (C {(test_expect_success)} {(SQ <'diff -U0'>)} { (SQ <'\n'> <'\n'> <'\tfor n in $sample\n'> <'\tdo\n'> <'\t\tgit diff -U0 file-?$n\n'> <'\tdone | zc >actual &&\n'> <'\ttest_cmp expect actual\n'> <'\n'> ) } ) (C {(test_done)}) ] )