(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'log/show --expand-tabs'>)}
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:HT) op:Equal rhs:{(DQ ('\t'))})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:title)
          op: Equal
          rhs: {(SQ <'tab indent at the beginning of the title line'>)}
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:body)
          op: Equal
          rhs: {(SQ <'tab indent on a line in the body'>)}
        )
      ]
    )
    (command.FuncDef
      name: count_expand
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:expect) op:Equal rhs:(word.EmptyWord))]
            )
            (command.Sentence
              child: 
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:count)
                      op: Equal
                      rhs: 
                        {
                          (word_part.ArithSubPart
                            anode: 
                              (arith_expr.ArithBinary
                                op_id: Arith_Plus
                                left: (arith_expr.ArithWord w:{($ VSub_Number '$1')})
                                right: (arith_expr.ArithWord w:{($ VSub_Number '$2')})
                              )
                          )
                        }
                    )
                  ]
                )
              terminator: <Op_Semi ';'>
            )
            (command.WhileUntil
              keyword: <KW_While while>
              cond: [(C {(test)} {($ VSub_DollarName '$count')} {(-gt)} {(0)})]
              body: 
                (command.DoGroup
                  children: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:expect)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$expect') (' '))}
                        )
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:count)
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArithSubPart
                                anode: 
                                  (arith_expr.ArithBinary
                                    op_id: Arith_Minus
                                    left: (arith_expr.ArithWord w:{($ VSub_DollarName '$count')})
                                    right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                  )
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
            )
            (C {(shift)} {(2)})
            (command.Sentence
              child: 
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:count)
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                    )
                  ]
                )
              terminator: <Op_Semi ';'>
            )
            (command.WhileUntil
              keyword: <KW_While while>
              cond: [(C {(test)} {($ VSub_DollarName '$count')} {(-gt)} {(0)})]
              body: 
                (command.DoGroup
                  children: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:expect)
                          op: Equal
                          rhs: {(DQ ($ VSub_DollarName '$expect') ($ VSub_DollarName '$HT'))}
                        )
                      ]
                    )
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:count)
                          op: Equal
                          rhs: 
                            {
                              (word_part.ArithSubPart
                                anode: 
                                  (arith_expr.ArithBinary
                                    op_id: Arith_Minus
                                    left: (arith_expr.ArithWord w:{($ VSub_DollarName '$count')})
                                    right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                  )
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
            )
            (C {(shift)})
            (command.Case
              to_match: {(DQ (' ') ($ VSub_Star '$*') (' '))}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (SQ <' --pretty=short '>) (Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:line)
                          op: Equal
                          rhs: {($ VSub_DollarName '$title')}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:line)
                          op: Equal
                          rhs: {($ VSub_DollarName '$body')}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.Pipeline
              children: [
                (command.BraceGroup
                  children: [
                    (C {(echo)} {(DQ ('git show -s ') ($ VSub_Star '$*'))})
                    (C {(echo)} {(DQ ($ VSub_DollarName '$expect') ($ VSub_DollarName '$line'))})
                  ]
                )
                (command.SimpleCommand
                  words: [{(sed)} {(-e)} {(SQ <'s/ /./g'>)}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})]
                )
              ]
              negated: F
            )
            (command.Pipeline
              children: [
                (command.BraceGroup
                  children: [
                    (C {(echo)} {(DQ ('git show -s ') ($ VSub_Star '$*'))})
                    (command.Pipeline
                      children: [
                        (C {(git)} {(show)} {(-s)} {(DQ ($ VSub_At '$@'))})
                        (C {(sed)} {(-n)} {(-e)} 
                          {
                            (DQ (/) ($ VSub_DollarName '$line') 
                              (word_part.EscapedLiteralPart
                                token: <Lit_EscapedChar '\\$'>
                              ) (/p)
                            )
                          }
                        )
                      ]
                      negated: F
                    )
                  ]
                )
                (command.SimpleCommand
                  words: [{(sed)} {(-e)} {(SQ <'s/ /./g'>)}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(actual)})]
                )
              ]
              negated: F
            )
            (C {(test_cmp)} {(expect)} {(actual)})
          ]
        )
    )
    (command.FuncDef
      name: test_expand
      body: 
        (command.BraceGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(lhs_expr.LhsName name:fmt) op:Equal rhs:{($ VSub_Number '$1')})]
            )
            (command.Case
              to_match: {(DQ ($ VSub_DollarName '$fmt'))}
              arms: [
                (case_arm
                  pat_list: [
                    {(Lit_Other '*') (Lit_Other '=') (raw)}
                    {(Lit_Other '*') (Lit_Other '=') (short)}
                    {(Lit_Other '*') (Lit_Other '=') (email)}
                  ]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:default)
                          op: Equal
                          rhs: {(DQ ('0 1'))}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (lhs_expr.LhsName name:default)
                          op: Equal
                          rhs: {(DQ ('8 0'))}
                        )
                      ]
                    )
                  ]
                )
              ]
            )
            (command.Case
              to_match: {(DQ ($ VSub_DollarName '$fmt'))}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (Lit_Other '=') (email)}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:in) op:Equal rhs:{(0)})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (command.Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:in) op:Equal rhs:{(4)})]
                    )
                  ]
                )
              ]
            )
            (C {(test_expect_success)} 
              {
                (DQ (expand/no-expand) 
                  (word_part.BracedVarSub
                    token: <VSub_Name fmt>
                    suffix_op: 
                      (suffix_op.StringUnary
                        op_id: VTest_ColonPlus
                        arg_word: {(' for ') ($ VSub_DollarName '$fmt')}
                      )
                  )
                )
              } 
              {
                (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'>
                )
              }
            )
          ]
        )
    )
    (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) (Lit_Other '=') (short)})
    (C {(test_expand)} {(--pretty) (Lit_Other '=') (medium)})
    (C {(test_expand)} {(--pretty) (Lit_Other '=') (full)})
    (C {(test_expand)} {(--pretty) (Lit_Other '=') (fuller)})
    (C {(test_expand)} {(--pretty) (Lit_Other '=') (raw)})
    (C {(test_expand)} {(--pretty) (Lit_Other '=') (email)})
    (C {(test_done)})
  ]
)