(command.CommandList
  children: [
    (command.ShFunction
      name: test_sort
      body: 
        (BraceGroup
          children: [
            (command.ShFunction
              name: do_one
              body: 
                (BraceGroup
                  children: [
                    (C {<sort_list>} {<0>} 
                      {
                        (braced_var_sub
                          token: <Id.VSub_Name list>
                          prefix_op: (Id.VSub_Pound)
                          bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                        ) <-1>
                      }
                    )
                    (C {<assertEquals>} {(DQ <0>)} {(DQ ($ Id.VSub_QMark '$?'))})
                    (C {<typeset>} {<-i>} {<i>})
                    (command.ForExpr
                      init: 
                        (arith_expr.BinaryAssign
                          op_id: Id.Arith_Equal
                          left: <Id.Lit_ArithVarLike i>
                          right: {<Id.Lit_Digits 0>}
                        )
                      cond: 
                        (arith_expr.Binary
                          op_id: Id.Arith_Less
                          left: <Id.Lit_ArithVarLike i>
                          right: 
                            {
                              (braced_var_sub
                                token: <Id.VSub_Name list>
                                prefix_op: (Id.VSub_Pound)
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              )
                            }
                        )
                      update: 
                        (arith_expr.UnaryAssign
                          op_id: Id.Node_PostDPlus
                          child: <Id.Lit_ArithVarLike i>
                        )
                      body: 
                        (command.DoGroup
                          children: [
                            (C {<assertEquals>} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name check>
                                    bracket_op: 
                                      (bracket_op.ArrayIndex
                                        expr: {($ Id.VSub_DollarName '$i')}
                                      )
                                  )
                                )
                              } 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name list>
                                    bracket_op: 
                                      (bracket_op.ArrayIndex
                                        expr: {($ Id.VSub_DollarName '$i')}
                                      )
                                  )
                                )
                              }
                            )
                          ]
                        )
                    )
                  ]
                )
            )
            (C {<typeset>} {<-a>} {<list>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _>)}
                  spids: [121]
                )
              ]
            )
            (C {<sort_list>} {<0>} {<0>})
            (C {<assertEquals>} {(DQ <2>)} {(DQ ($ Id.VSub_QMark '$?'))})
            (C {<assertEquals>} {(DQ <0>)} 
              {
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Name list>
                    prefix_op: (Id.VSub_Pound)
                    bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                  )
                )
              }
            )
            (C {<sort_list>} {<1>} {<1>})
            (C {<assertNotEquals>} {(DQ <0>)} {(DQ ($ Id.VSub_QMark '$?'))})
            (C {<typeset>} {<-a>} {<check>})
            (command.Sentence
              child: 
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:list)
                      op: assign_op.Equal
                      rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{(SQ <one>)}])}
                      spids: [189]
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:check)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{(SQ <one>)}])}
                  spids: [197]
                )
              ]
            )
            (C {<do_one>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{(SQ <one>)} {(SQ <two>)} {(SQ <three>)}]
                      )
                    }
                  spids: [208]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:check)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{(SQ <one>)} {(SQ <three>)} {(SQ <two>)}]
                      )
                    }
                  spids: [225]
                )
              ]
            )
            (C {<do_one>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{<4>} {<3>} {<2>} {<1>}])}
                  spids: [244]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:check)
                  op: assign_op.Equal
                  rhs: {(sh_array_literal left:<Id.Op_LParen _> words:[{<1>} {<2>} {<3>} {<4>}])}
                  spids: [256]
                )
              ]
            )
            (C {<do_one>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:list)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [{(SQ <' 4'>)} {(SQ <'3 '>)} {(SQ <2>)} {(SQ <1>)}]
                      )
                    }
                  spids: [271]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.Op_Less
                                  left: {(SQ <' 4'>)}
                                  right: {(SQ <1>)}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:check)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [{(SQ <' 4'>)} {(SQ <1>)} {(SQ <2>)} {(SQ <'3 '>)}]
                              )
                            }
                          spids: [312]
                        )
                      ]
                    )
                  ]
                  spids: [291 309]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:check)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (sh_array_literal
                            left: <Id.Op_LParen _>
                            words: [{(SQ <1>)} {(SQ <2>)} {(SQ <'3 '>)} {(SQ <' 4'>)}]
                          )
                        }
                      spids: [335]
                    )
                  ]
                )
              ]
            )
            (C {<do_one>})
            (C {<sort_list>} {<0>} {<10>})
            (C {<assertNotEquals>} {(DQ <0>)} {(DQ ($ Id.VSub_QMark '$?'))})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (C {<Id.Lit_LBracket '['>} {(SQ <'/src/external-vcs/sourceforge/bashdb'>)} 
                      {<Id.Lit_Equals '='>} {(SQ )} {<Id.Lit_RBracket ']'>}
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (C {<echo>} {(DQ <'Something is wrong abs_top_srcdir is not set.'>)})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [384 401]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:abs_top_srcdir)
          op: assign_op.Equal
          rhs: {<'/src/external-vcs/sourceforge/bashdb'>}
          spids: [417]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:abs_top_srcdir)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name abs_top_srcdir>
                suffix_op: (suffix_op.Unary tok:<Id.VOp1_DPercent '%%'> arg_word:{<Id.Lit_Slash '/'>})
              ) <'/'>
            }
          spids: [423]
        )
      ]
    )
    (C {<.>} {(${ Id.VSub_Name abs_top_srcdir) <'test/unit/helper.sh'>})
    (C {<.>} {($ Id.VSub_DollarName '$abs_top_srcdir') <'/lib/sort.sh'>})
    (C {<set>} {<-->})
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {($ Id.VSub_Number '$0')}
              right: {(${ Id.VSub_Name BASH_SOURCE)}
            )
        )
        (C {<.>} {(${ Id.VSub_Name shunit_file)})
      ]
    )
  ]
)