(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'log/show --expand-tabs'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'HT='> name:HT) op: assign_op.Equal rhs: {(DQ <'\t'>)} spids: [15] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'title='> name:title) op: assign_op.Equal rhs: {(SQ <'tab indent at the beginning of the title line'>)} spids: [20] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'body='> name:body) op: assign_op.Equal rhs: {(SQ <'tab indent on a line in the body'>)} spids: [25] ) ] redirects: [] ) (command.ShFunction name: count_expand body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expect='> name:expect) op: assign_op.Equal rhs: (rhs_word.Empty) spids: [42] ) ] redirects: [] ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'count='> name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: {($ Id.VSub_Number 1)} right: {($ Id.VSub_Number 2)} ) ) } spids: [45] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [(C {<test>} {($ Id.VSub_DollarName count)} {<-gt>} {<0>})] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expect='> name:expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName expect) <' '>)} spids: [76] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'count='> name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName count)} right: {<Id.Lit_Digits 1>} ) ) } spids: [83] ) ] redirects: [] ) ] ) redirects: [] ) (C {<shift>} {<2>}) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'count='> name:count) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} spids: [104] ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [(C {<test>} {($ Id.VSub_DollarName count)} {<-gt>} {<0>})] ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expect='> name:expect) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName expect) ($ Id.VSub_DollarName HT))} spids: [126] ) ] redirects: [] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'count='> name:count) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName count)} right: {<Id.Lit_Digits 1>} ) ) } spids: [133] ) ] redirects: [] ) ] ) redirects: [] ) (C {<shift>}) (command.Case to_match: {(DQ <' '> ($ Id.VSub_Star '*') <' '>)} arms: [ (case_arm pat_list: [{<Id.Lit_Star '*'> (SQ <' --pretty=short '>) <Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'line='> name:line) op: assign_op.Equal rhs: {($ Id.VSub_DollarName title)} spids: [176] ) ] redirects: [] ) ] spids: [168 173 179 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'line='> name:line) op: assign_op.Equal rhs: {($ Id.VSub_DollarName body)} spids: [186] ) ] redirects: [] ) ] spids: [182 183 189 -1] ) ] redirects: [] ) (command.Pipeline children: [ (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (C {<echo>} {(DQ <'git show -s '> ($ Id.VSub_Star '*'))}) (C {<echo>} {(DQ ($ Id.VSub_DollarName expect) ($ Id.VSub_DollarName line))}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) (command.Simple words: [{<sed>} {<-e>} {(SQ <'s/ /./g'>)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})] more_env: [] do_fork: T ) ] negated: F stderr_indices: [] ) (command.Pipeline children: [ (BraceGroup left: <Id.Lit_LBrace '{'> 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: <Id.Lit_EscapedChar '\\$'> ch: '$' ) <'/p'> ) } ) ] negated: F stderr_indices: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) (command.Simple words: [{<sed>} {<-e>} {(SQ <'s/ /./g'>)}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<actual>})] more_env: [] do_fork: T ) ] negated: F stderr_indices: [] ) (C {<test_cmp>} {<expect>} {<actual>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name: test_expand body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fmt='> name:fmt) op: assign_op.Equal rhs: {($ Id.VSub_Number 1)} spids: [320] ) ] redirects: [] ) (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 left:<Id.Lit_VarLike 'default='> name:default) op: assign_op.Equal rhs: {(DQ <'0 1'>)} spids: [351] ) ] redirects: [] ) ] spids: [333 348 356 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'default='> name:default) op: assign_op.Equal rhs: {(DQ <'8 0'>)} spids: [363] ) ] redirects: [] ) ] spids: [359 360 368 -1] ) ] redirects: [] ) (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 left:<Id.Lit_VarLike 'in='> name:in) op: assign_op.Equal rhs: {<0>} spids: [389] ) ] redirects: [] ) ] spids: [383 386 392 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'in='> name:in) op: assign_op.Equal rhs: {<4>} spids: [399] ) ] redirects: [] ) ] spids: [395 396 402 -1] ) ] redirects: [] ) (C {<test_expect_success>} { (DQ <'expand/no-expand'> (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name fmt> var_name: fmt suffix_op: (suffix_op.Unary op: <Id.VTest_ColonPlus _> arg_word: {<' for '> ($ Id.VSub_DollarName fmt)} ) right: <Id.Right_DollarBrace '}'> ) ) } { (SQ <'\n'> <'\t\tcount_expand $in $default $fmt &&\n'> <'\t\tcount_expand $in 8 0 $fmt --expand-tabs &&\n'> <'\t\tcount_expand $in 8 0 --expand-tabs $fmt &&\n'> <'\t\tcount_expand $in 8 0 $fmt --expand-tabs=8 &&\n'> <'\t\tcount_expand $in 8 0 --expand-tabs=8 $fmt &&\n'> <'\t\tcount_expand $in 0 1 $fmt --no-expand-tabs &&\n'> <'\t\tcount_expand $in 0 1 --no-expand-tabs $fmt &&\n'> <'\t\tcount_expand $in 0 1 $fmt --expand-tabs=0 &&\n'> <'\t\tcount_expand $in 0 1 --expand-tabs=0 $fmt &&\n'> <'\t\tcount_expand $in 4 0 $fmt --expand-tabs=4 &&\n'> <'\t\tcount_expand $in 4 0 --expand-tabs=4 $fmt\n'> <'\t'> ) } ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\ttest_tick &&\n'> <'\tsed -e "s/Q/$HT/g" <<-EOF >msg &&\n'> <'\tQ$title\n'> <'\n'> <'\tQ$body\n'> <'\tEOF\n'> <'\tgit commit --allow-empty -F msg\n'> ) } ) (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>}) ] )