(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:'log/show --expand-tabs' span_id:6))} spids: [4] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:HT) op: assign_op.Equal rhs: {(DQ ('\t'))} spids: [15] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:title) op: assign_op.Equal rhs: { (SQ (Token id: Id.Lit_Chars val: 'tab indent at the beginning of the title line' span_id: 22 ) ) } spids: [20] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:body) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'tab indent on a line in the body' span_id:27))} spids: [25] ) ] ) (command.ShFunction name: count_expand body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: (word.Empty) spids: [42] ) ] ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{($ Id.VSub_Number '$1')}) right: (arith_expr.ArithWord w:{($ Id.VSub_Number '$2')}) ) ) } spids: [45] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:57) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:62) cond: [(C {(test)} {($ Id.VSub_DollarName '$count')} {(-gt)} {(0)})] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$expect') (' '))} spids: [76] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$count')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [83] ) ] ) ] ) ) (C {(shift)} {(2)}) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [104] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:107) ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:112) cond: [(C {(test)} {($ Id.VSub_DollarName '$count')} {(-gt)} {(0)})] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$expect') ($ Id.VSub_DollarName '$HT'))} spids: [126] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$count')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [133] ) ] ) ] ) ) (C {(shift)}) (command.Case to_match: {(DQ (' ') ($ Id.VSub_Star '$*') (' '))} arms: [ (case_arm pat_list: [ {(Id.Lit_Star '*') (SQ (Token id:Id.Lit_Chars val:' --pretty=short ' span_id:170)) (Id.Lit_Star '*') } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$title')} spids: [176] ) ] ) ] spids: [168 173 179 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:line) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$body')} spids: [186] ) ] ) ] spids: [182 183 189 -1] ) ] ) (command.Pipeline children: [ (command.BraceGroup children: [ (C {(echo)} {(DQ ('git show -s ') ($ Id.VSub_Star '$*'))}) (C {(echo)} {(DQ ($ Id.VSub_DollarName '$expect') ($ Id.VSub_DollarName '$line'))}) ] ) (command.Simple words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/ /./g' span_id:240))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:243) fd: -1 arg_word: {(expect)} ) ] ) ] negated: F ) (command.Pipeline children: [ (command.BraceGroup children: [ (C {(echo)} {(DQ ('git show -s ') ($ Id.VSub_Star '$*'))}) (command.Pipeline children: [ (C {(git)} {(show)} {(-s)} {(DQ ($ Id.VSub_At '$@'))}) (C {(sed)} {(-n)} {(-e)} { (DQ (/) ($ Id.VSub_DollarName '$line') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:281) ) (/p) ) } ) ] negated: F ) ] ) (command.Simple words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/ /./g' span_id:295))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:298) fd: -1 arg_word: {(actual)} ) ] ) ] negated: F ) (C {(test_cmp)} {(expect)} {(actual)}) ] ) ) (command.ShFunction name: test_expand body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fmt) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [320] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$fmt'))} arms: [ (case_arm pat_list: [ {(Id.Lit_Star '*') (Id.Lit_Equals '=') (raw)} {(Id.Lit_Star '*') (Id.Lit_Equals '=') (short)} {(Id.Lit_Star '*') (Id.Lit_Equals '=') (email)} ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:default) op: assign_op.Equal rhs: {(DQ ('0 1'))} spids: [351] ) ] ) ] spids: [333 348 356 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:default) op: assign_op.Equal rhs: {(DQ ('8 0'))} spids: [363] ) ] ) ] spids: [359 360 368 -1] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$fmt'))} arms: [ (case_arm pat_list: [{(Id.Lit_Star '*') (Id.Lit_Equals '=') (email)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:in) op: assign_op.Equal rhs: {(0)} spids: [389] ) ] ) ] spids: [383 386 392 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:in) op: assign_op.Equal rhs: {(4)} spids: [399] ) ] ) ] spids: [395 396 402 -1] ) ] ) (C {(test_expect_success)} { (DQ (expand/no-expand) (braced_var_sub token: (Token id:Id.VSub_Name val:fmt span_id:413) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonPlus arg_word: {(' for ') ($ Id.VSub_DollarName '$fmt')} ) ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:421) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in $default $fmt &&\n' span_id: 422 ) (Token id:Id.Lit_Chars val:'\t\tcount_expand $in 8 0 $fmt --expand-tabs &&\n' span_id:423) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in 8 0 --expand-tabs $fmt &&\n' span_id: 424 ) (Token id:Id.Lit_Chars val:'\t\tcount_expand $in 8 0 $fmt --expand-tabs=8 &&\n' span_id:425) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in 8 0 --expand-tabs=8 $fmt &&\n' span_id: 426 ) (Token id:Id.Lit_Chars val:'\t\tcount_expand $in 0 1 $fmt --no-expand-tabs &&\n' span_id:427) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in 0 1 --no-expand-tabs $fmt &&\n' span_id: 428 ) (Token id:Id.Lit_Chars val:'\t\tcount_expand $in 0 1 $fmt --expand-tabs=0 &&\n' span_id:429) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in 0 1 --expand-tabs=0 $fmt &&\n' span_id: 430 ) (Token id:Id.Lit_Chars val:'\t\tcount_expand $in 4 0 $fmt --expand-tabs=4 &&\n' span_id:431) (Token id: Id.Lit_Chars val: '\t\tcount_expand $in 4 0 --expand-tabs=4 $fmt\n' span_id: 432 ) (Token id:Id.Lit_Chars val:'\t' span_id:433) ) } ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:442))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:446) (Token id:Id.Lit_Chars val:'\ttest_tick &&\n' span_id:447) (Token id:Id.Lit_Chars val:'\tsed -e "s/Q/$HT/g" <<-EOF >msg &&\n' span_id:448) (Token id:Id.Lit_Chars val:'\tQ$title\n' span_id:449) (Token id:Id.Lit_Chars val:'\n' span_id:450) (Token id:Id.Lit_Chars val:'\tQ$body\n' span_id:451) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:452) (Token id:Id.Lit_Chars val:'\tgit commit --allow-empty -F msg\n' span_id:453) ) } ) (C {(test_expand)} {(DQ )}) (C {(test_expand)} {(--pretty)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (short)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (medium)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (full)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (fuller)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (raw)}) (C {(test_expand)} {(--pretty) (Id.Lit_Equals '=') (email)}) (C {(test_done)}) ] )