(command.CommandList
  children: [
    (command.ShFunction
      name: test_eval_subst
      body: 
        (BraceGroup
          children: [
            (C {<typeset>} {<extracted>})
            (C {<typeset>} {<-a>} {<texts>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:texts)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(SQ <'if (( x == 1 )); then'>)}
                          {(SQ <'if (( y == 2 )) ; then'>)}
                          {(SQ <'if (( y == 3 )) ;'>)}
                          {(SQ <'if (( y == 4 ))'>)}
                          {(SQ <'if (( z == 5 ))   '>)}
                          {(SQ <'return something'>)}
                          {(SQ <'elif [[ $x = test1 ]] && [ $? -eq 0 ] ; then'>)}
                          {(SQ <'while [[ $x = test2 ]] && [ $? -eq 0 ] ; do'>)}
                          {(SQ <'while [[ $x = test3 ]] && [ $? -eq 0 ]'>)}
                        ]
                      )
                    }
                  spids: [30]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:expected)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (sh_array_literal
                        left: <Id.Op_LParen _>
                        words: [
                          {(SQ <'(( x == 1 ))'>)}
                          {(SQ <'(( y == 2 )) '>)}
                          {(SQ <'(( y == 3 )) '>)}
                          {(SQ <'(( y == 4 ))'>)}
                          {(SQ <'(( z == 5 ))   '>)}
                          {(SQ <'echo something'>)}
                          {(SQ <'[[ $x = test1 ]] && [ $? -eq 0 ] '>)}
                          {(SQ <'[[ $x = test2 ]] && [ $? -eq 0 ] '>)}
                          {(SQ <'[[ $x = test3 ]] && [ $? -eq 0 ]'>)}
                        ]
                      )
                    }
                  spids: [84]
                )
              ]
            )
            (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 expected>
                        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 {<_Dbg_eval_extract_condition>} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: <Id.VSub_Name texts>
                            bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                          )
                        )
                      }
                    )
                    (C {<assertEquals>} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: <Id.VSub_Name expected>
                            bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                          )
                        )
                      } {(DQ ($ Id.VSub_DollarName '$extracted'))}
                    )
                  ]
                )
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:assign)
                  op: assign_op.Equal
                  rhs: {(SQ <'foo=bar'>)}
                  spids: [206]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:pat)
                  op: assign_op.Equal
                  rhs: {(SQ <'^[ \\t]*[A-Za-z_][A-Za-z_0-9[]*[]-+]?=(.*$)'>)}
                  spids: [212]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_EqualTilde
                                  left: {($ Id.VSub_DollarName '$assign')}
                                  right: {($ Id.VSub_DollarName '$pat')}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:texts)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [
                                  {(SQ <'x=10'>)}
                                  {(SQ <'array[1]=20'>)}
                                  {(SQ <'__fn__+=30'>)}
                                  {(SQ <'PROFILES="/etc/apparmor.d"'>)}
                                ]
                              )
                            }
                          spids: [235]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:expected)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: <Id.Op_LParen _>
                                words: [
                                  {(SQ <'echo 10'>)}
                                  {(SQ <'echo 20'>)}
                                  {(SQ <'echo 30'>)}
                                  {(SQ <'echo "/etc/apparmor.d"'>)}
                                ]
                              )
                            }
                          spids: [263]
                        )
                      ]
                    )
                    (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 expected>
                                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 {<_Dbg_eval_extract_condition>} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name texts>
                                    bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                                  )
                                )
                              }
                            )
                            (C {<assertEquals>} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: <Id.VSub_Name expected>
                                    bracket_op: (bracket_op.ArrayIndex expr:<Id.Lit_ArithVarLike i>)
                                  )
                                )
                              } {(DQ ($ Id.VSub_DollarName '$extracted'))}
                            )
                          ]
                        )
                    )
                  ]
                  spids: [218 232]
                )
              ]
            )
          ]
        )
    )
    (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: [358]
        )
      ]
    )
    (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: [364]
        )
      ]
    )
    (C {<.>} {(${ Id.VSub_Name abs_top_srcdir) <'test/unit/helper.sh'>})
    (C {<.>} {(${ Id.VSub_Name abs_top_srcdir) <'lib/fns.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)})
      ]
    )
  ]
)