(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'log/show --expand-tabs'>)}
          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 <'tab indent at the beginning of the title line'>)}
          spids: [20]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:body)
          op: assign_op.Equal
          rhs: {(SQ <'tab indent on a line in the body'>)}
          spids: [25]
        )
      ]
    )
    (command.ShFunction
      name: count_expand
      body: 
        (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: {($ Id.VSub_Number '$1')}
                                right: {($ Id.VSub_Number '$2')}
                              )
                          )
                        }
                      spids: [45]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              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: {($ Id.VSub_DollarName '$count')}
                                    right: {<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: <Id.Op_Semi _>
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              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: {($ Id.VSub_DollarName '$count')}
                                    right: {<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 <' --pretty=short '>) <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: [
                (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 <'s/ /./g'>)}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>})]
                  do_fork: T
                )
              ]
              negated: F
            )
            (command.Pipeline
              children: [
                (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: <Id.Lit_EscapedChar '\\$'>
                              ) <'/p'>
                            )
                          }
                        )
                      ]
                      negated: F
                    )
                  ]
                )
                (command.Simple
                  words: [{<sed>} {<-e>} {(SQ <'s/ /./g'>)}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<actual>})]
                  do_fork: T
                )
              ]
              negated: F
            )
            (C {<test_cmp>} {<expect>} {<actual>})
          ]
        )
    )
    (command.ShFunction
      name: test_expand
      body: 
        (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: <Id.VSub_Name fmt>
                    suffix_op: 
                      (suffix_op.Unary
                        op_id: Id.VTest_ColonPlus
                        arg_word: {<' for '> ($ Id.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> <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>})
  ]
)