(command.CommandList
  children: [
    (command.Simple blame_tok:<set> more_env:[] words:[{<set>} {<-e>}] redirects:[] do_fork:T)
    (command.Simple blame_tok:<set> more_env:[] words:[{<set>} {<-E>}] redirects:[] do_fork:T)
    (command.Simple blame_tok:<set> more_env:[] words:[{<set>} {<-T>}] redirects:[] do_fork:T)
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_COUNT_ONLY='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_COUNT_ONLY='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_COUNT_ONLY='> name:BATS_COUNT_ONLY)
          op: assign_op.Equal
          rhs: {(DQ )}
        )
      ]
      redirects: []
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {(DQ ($ Id.VSub_Number 1))}
                        {<Id.Lit_Equals '='>}
                        {(DQ <-c>)}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_COUNT_ONLY='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_COUNT_ONLY='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_COUNT_ONLY='>
                      name: BATS_COUNT_ONLY
                    )
                  op: assign_op.Equal
                  rhs: {<1>}
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <shift>
              more_env: []
              words: [{<shift>}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [20 37]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
              name: BATS_EXTENDED_SYNTAX
            )
          op: assign_op.Equal
          rhs: {(DQ )}
        )
      ]
      redirects: []
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {(DQ ($ Id.VSub_Number 1))}
                        {<Id.Lit_Equals '='>}
                        {(DQ <-x>)}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_EXTENDED_SYNTAX='>
                      name: BATS_EXTENDED_SYNTAX
                    )
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <shift>
              more_env: []
              words: [{<shift>}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [53 70]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_TEST_FILENAME='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_TEST_FILENAME='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TEST_FILENAME='> name:BATS_TEST_FILENAME)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_Number 1))}
        )
      ]
      redirects: []
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {<-z>}
                        {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ <'usage: bats-exec <filename>'>)}]
              redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [89 102]
        )
        (IfArm
          keyword: <Id.KW_Elif elif>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {<Id.KW_Bang '!'>}
                        {<-f>}
                        {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [
                {<echo>}
                {(DQ <'bats: '> ($ Id.VSub_DollarName BATS_TEST_FILENAME) <' does not exist'>)}
              ]
              redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [119 134]
        )
      ]
      else_kw: <Id.KW_Else else>
      else_action: [
        (command.Simple
          blame_tok: <shift>
          more_env: []
          words: [{<shift>}]
          redirects: []
          do_fork: T
        )
      ]
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_TEST_DIRNAME='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_TEST_DIRNAME='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TEST_DIRNAME='> name:BATS_TEST_DIRNAME)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.Simple
                      blame_tok: <dirname>
                      more_env: []
                      words: [{<dirname>} {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}]
                      redirects: []
                      do_fork: T
                    )
                  right: <Id.Eof_RParen _>
                )
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_TEST_NAMES='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_TEST_NAMES='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TEST_NAMES='> name:BATS_TEST_NAMES)
          op: assign_op.Equal
          rhs: {(ShArrayLiteral left:<Id.Op_LParen _> words:[] right:<Id.Right_ShArrayLiteral _>)}
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <load>
      name: load
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'name='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<filename>}]
              redirects: []
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name name>
                                      var_name: name
                                      suffix_op: 
                                        (suffix_op.Slice
                                          begin: {<Id.Lit_Digits 0>}
                                          length: {<Id.Lit_Digits 1>}
                                        )
                                      right: <Id.Arith_RBrace _>
                                    )
                                  )
                                }
                                {<Id.Lit_Equals '='>}
                                {(DQ <'/'>)}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'filename='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'filename='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filename='> name:filename)
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name name))}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [198 221]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'filename='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'filename='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'filename='> name:filename)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (DQ ($ Id.VSub_DollarName BATS_TEST_DIRNAME) <'/'> (${ Id.VSub_Name name) 
                            <.bash>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <Id.Lit_LBracket '['>
                  more_env: []
                  words: [
                    {<Id.Lit_LBracket '['>}
                    {<-f>}
                    {(DQ ($ Id.VSub_DollarName filename))}
                    {<Id.Lit_RBracket ']'>}
                  ]
                  redirects: []
                  do_fork: T
                )
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [
                        {<echo>}
                        {(DQ <'bats: '> ($ Id.VSub_DollarName filename) <' does not exist'>)}
                      ]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      keyword: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.Simple
              blame_tok: <source>
              more_env: []
              words: [{<source>} {(DQ (${ Id.VSub_Name filename))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <run>
      name: run
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<e>} {<E>} {<T>} {<oldIFS>}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.LogicalNot
                      child: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_EqualTilde
                          left: {(DQ ($ Id.VSub_Hyphen -))}
                          right: {<e>}
                        )
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'e='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'e='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'e='> name:e)
                      op: assign_op.Equal
                      rhs: {<1>}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.LogicalNot
                      child: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_EqualTilde
                          left: {(DQ ($ Id.VSub_Hyphen -))}
                          right: {<E>}
                        )
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'E='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'E='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'E='> name:E)
                      op: assign_op.Equal
                      rhs: {<1>}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.AndOr
              children: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.LogicalNot
                      child: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_EqualTilde
                          left: {(DQ ($ Id.VSub_Hyphen -))}
                          right: {<T>}
                        )
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'T='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'T='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'T='> name:T)
                      op: assign_op.Equal
                      rhs: {<1>}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.Simple
              blame_tok: <set>
              more_env: []
              words: [{<set>} {<Id.Lit_Other '+'> <e>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <set>
              more_env: []
              words: [{<set>} {<Id.Lit_Other '+'> <E>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <set>
              more_env: []
              words: [{<set>} {<Id.Lit_Other '+'> <T>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'output='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'output='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'output='> name:output)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (command.Simple
                              blame_tok: <Id.Left_DoubleQuote '"'>
                              more_env: []
                              words: [{(DQ ($ Id.VSub_At '@'))}]
                              redirects: [
                                (Redir
                                  op: <Id.Redir_GreatAnd '2>&'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<1>}
                                )
                              ]
                              do_fork: T
                            )
                          right: <Id.Eof_RParen _>
                        )
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'status='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'status='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_QMark '?'))}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'oldIFS='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'oldIFS='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'oldIFS='> name:oldIFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName IFS)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'IFS='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'IFS='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'IFS='> name:IFS)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (SingleQuoted
                        left: <Id.Left_DollarSingleQuote '$\''>
                        tokens: [<Id.Char_OneChar '\\n'>]
                        right: <Id.Right_SingleQuote '\''>
                      )
                    }
                )
                (AssignPair
                  left: <Id.Lit_VarLike 'lines='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'lines='> name:lines)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [{($ Id.VSub_DollarName output)}]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <Id.Lit_LBracket '['>
                  more_env: []
                  words: [
                    {<Id.Lit_LBracket '['>}
                    {<-z>}
                    {(DQ ($ Id.VSub_DollarName e))}
                    {<Id.Lit_RBracket ']'>}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <set>
                  more_env: []
                  words: [{<set>} {<-e>}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <Id.Lit_LBracket '['>
                  more_env: []
                  words: [
                    {<Id.Lit_LBracket '['>}
                    {<-z>}
                    {(DQ ($ Id.VSub_DollarName E))}
                    {<Id.Lit_RBracket ']'>}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <set>
                  more_env: []
                  words: [{<set>} {<-E>}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <Id.Lit_LBracket '['>
                  more_env: []
                  words: [
                    {<Id.Lit_LBracket '['>}
                    {<-z>}
                    {(DQ ($ Id.VSub_DollarName T))}
                    {<Id.Lit_RBracket ']'>}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <set>
                  more_env: []
                  words: [{<set>} {<-T>}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'IFS='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'IFS='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'IFS='> name:IFS)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_DollarName oldIFS)}
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <setup>
      name: setup
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <true>
              more_env: []
              words: [{<true>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <teardown>
      name: teardown
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <true>
              more_env: []
              words: [{<true>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <skip>
      name: skip
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TEST_SKIPPED='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TEST_SKIPPED='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_TEST_SKIPPED='>
                      name: BATS_TEST_SKIPPED
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (BracedVarSub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Number 1>
                        var_name: 1
                        suffix_op: (suffix_op.Unary op:<Id.VTest_ColonHyphen _> arg_word:{<1>})
                        right: <Id.Right_DollarBrace '}'>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                      name: BATS_TEST_COMPLETED
                    )
                  op: assign_op.Equal
                  rhs: {<1>}
                )
              ]
              redirects: []
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_test_begin>
      name: bats_test_begin
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TEST_DESCRIPTION='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TEST_DESCRIPTION='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_TEST_DESCRIPTION='>
                      name: BATS_TEST_DESCRIPTION
                    )
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                )
              ]
              redirects: []
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {<-n>}
                                {(DQ ($ Id.VSub_DollarName BATS_EXTENDED_SYNTAX))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [
                        {<echo>}
                        {
                          (DQ <'begin '> ($ Id.VSub_DollarName BATS_TEST_NUMBER) <' '> 
                            ($ Id.VSub_DollarName BATS_TEST_DESCRIPTION)
                          )
                        }
                      ]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<3>})]
                      do_fork: T
                    )
                  ]
                  spids: [547 560]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <setup>
              more_env: []
              words: [{<setup>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_test_function>
      name: bats_test_function
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'test_name='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_ArrayLhsOpen 'BATS_TEST_NAMES['>
              pairs: [
                (AssignPair
                  left: <Id.Lit_ArrayLhsOpen 'BATS_TEST_NAMES['>
                  lhs: 
                    (sh_lhs_expr.IndexedName
                      left: <Id.Lit_ArrayLhsOpen 'BATS_TEST_NAMES['>
                      name: BATS_TEST_NAMES
                      index: 
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Name BATS_TEST_NAMES>
                              var_name: BATS_TEST_NAMES
                              prefix_op: <Id.VSub_Pound '#'>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              right: <Id.Right_DollarBrace '}'>
                            )
                          )
                        }
                    )
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName test_name))}
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_capture_stack_trace>
      name: bats_capture_stack_trace
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_PREVIOUS_STACK_TRACE='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_PREVIOUS_STACK_TRACE='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_PREVIOUS_STACK_TRACE='>
                      name: BATS_PREVIOUS_STACK_TRACE
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [
                          {
                            (DQ 
                              (BracedVarSub
                                left: <Id.Left_DollarBrace '${'>
                                token: <Id.VSub_Name BATS_CURRENT_STACK_TRACE>
                                var_name: BATS_CURRENT_STACK_TRACE
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                right: <Id.Right_DollarBrace '}'>
                              )
                            )
                          }
                        ]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_CURRENT_STACK_TRACE='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_CURRENT_STACK_TRACE='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_CURRENT_STACK_TRACE='>
                      name: BATS_CURRENT_STACK_TRACE
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: []
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'test_pattern='> 
                  (DQ <' '> ($ Id.VSub_DollarName BATS_TEST_NAME) <' '> 
                    ($ Id.VSub_DollarName BATS_TEST_SOURCE)
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'setup_pattern='> 
                  (DQ <' setup '> ($ Id.VSub_DollarName BATS_TEST_SOURCE))
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'teardown_pattern='> 
                  (DQ <' teardown '> ($ Id.VSub_DollarName BATS_TEST_SOURCE))
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<frame>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'index='> <1>}]
              redirects: []
              do_fork: T
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: 
                (condition.Shell
                  commands: [
                    (command.Sentence
                      child: 
                        (command.ShAssignment
                          left: <Id.Lit_VarLike 'frame='>
                          pairs: [
                            (AssignPair
                              left: <Id.Lit_VarLike 'frame='>
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'frame='> name:frame)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (CommandSub
                                      left_token: <Id.Left_DollarParen '$('>
                                      child: 
                                        (command.Simple
                                          blame_tok: <caller>
                                          more_env: []
                                          words: [{<caller>} {(DQ ($ Id.VSub_DollarName index))}]
                                          redirects: []
                                          do_fork: T
                                        )
                                      right: <Id.Eof_RParen _>
                                    )
                                  )
                                }
                            )
                          ]
                          redirects: []
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                )
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.ShAssignment
                      left: <Id.Lit_ArrayLhsOpen 'BATS_CURRENT_STACK_TRACE['>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_ArrayLhsOpen 'BATS_CURRENT_STACK_TRACE['>
                          lhs: 
                            (sh_lhs_expr.IndexedName
                              left: <Id.Lit_ArrayLhsOpen 'BATS_CURRENT_STACK_TRACE['>
                              name: BATS_CURRENT_STACK_TRACE
                              index: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name BATS_CURRENT_STACK_TRACE>
                                      var_name: BATS_CURRENT_STACK_TRACE
                                      prefix_op: <Id.VSub_Pound '#'>
                                      bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                      right: <Id.Right_DollarBrace '}'>
                                    )
                                  )
                                }
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName frame))}
                        )
                      ]
                      redirects: []
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.DBracket
                                      left: <Id.KW_DLeftBracket '[['>
                                      expr: 
                                        (bool_expr.LogicalOr
                                          left: 
                                            (bool_expr.Binary
                                              op_id: Id.BoolBinary_GlobEqual
                                              left: {(DQ ($ Id.VSub_DollarName frame))}
                                              right: 
                                                {<Id.Lit_Other '*'> 
                                                  (DQ ($ Id.VSub_DollarName test_pattern))
                                                }
                                            )
                                          right: 
                                            (bool_expr.LogicalOr
                                              left: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobEqual
                                                  left: {(DQ ($ Id.VSub_DollarName frame))}
                                                  right: 
                                                    {<Id.Lit_Other '*'> 
                                                      (DQ ($ Id.VSub_DollarName setup_pattern))
                                                    }
                                                )
                                              right: 
                                                (bool_expr.Binary
                                                  op_id: Id.BoolBinary_GlobEqual
                                                  left: {(DQ ($ Id.VSub_DollarName frame))}
                                                  right: 
                                                    {<Id.Lit_Other '*'> 
                                                      (DQ ($ Id.VSub_DollarName teardown_pattern))
                                                    }
                                                )
                                            )
                                        )
                                      right: <Id.Lit_DRightBracket ']]'>
                                      redirects: []
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [(command.ControlFlow keyword:<Id.ControlFlow_Break break>)]
                          spids: [740 788]
                        )
                      ]
                      else_kw: <Id.KW_Else else>
                      else_action: [
                        (command.Simple
                          blame_tok: <let>
                          more_env: []
                          words: [{<let>} {<Id.Lit_VarLike 'index+='> <1>}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_SOURCE='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_SOURCE='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_SOURCE='> name:BATS_SOURCE)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (command.Simple
                              blame_tok: <bats_frame_filename>
                              more_env: []
                              words: [
                                {<bats_frame_filename>}
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name BATS_CURRENT_STACK_TRACE>
                                      var_name: BATS_CURRENT_STACK_TRACE
                                      bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                      right: <Id.Right_DollarBrace '}'>
                                    )
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          right: <Id.Eof_RParen _>
                        )
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_LINENO='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_LINENO='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_LINENO='> name:BATS_LINENO)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (command.Simple
                              blame_tok: <bats_frame_lineno>
                              more_env: []
                              words: [
                                {<bats_frame_lineno>}
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name BATS_CURRENT_STACK_TRACE>
                                      var_name: BATS_CURRENT_STACK_TRACE
                                      bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>})
                                      right: <Id.Right_DollarBrace '}'>
                                    )
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          right: <Id.Eof_RParen _>
                        )
                      )
                    }
                )
              ]
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_print_stack_trace>
      name: bats_print_stack_trace
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<frame>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'index='> <1>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'count='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_At '@'>
                      var_name: '@'
                      prefix_op: <Id.VSub_Pound '#'>
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.ForEach
              keyword: <Id.KW_For for>
              iter_names: [frame]
              iterable: (for_iter.Words words:[{(DQ ($ Id.VSub_At '@'))}])
              semi_tok: <Id.Op_Semi _>
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.Simple
                      blame_tok: <local>
                      more_env: []
                      words: [
                        {<local>}
                        {<Id.Lit_VarLike 'filename='> 
                          (DQ 
                            (CommandSub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Simple
                                  blame_tok: <bats_trim_filename>
                                  more_env: []
                                  words: [
                                    {<bats_trim_filename>}
                                    {
                                      (DQ 
                                        (CommandSub
                                          left_token: <Id.Left_DollarParen '$('>
                                          child: 
                                            (command.Simple
                                              blame_tok: <bats_frame_filename>
                                              more_env: []
                                              words: [
                                                {<bats_frame_filename>}
                                                {(DQ ($ Id.VSub_DollarName frame))}
                                              ]
                                              redirects: []
                                              do_fork: T
                                            )
                                          right: <Id.Eof_RParen _>
                                        )
                                      )
                                    }
                                  ]
                                  redirects: []
                                  do_fork: T
                                )
                              right: <Id.Eof_RParen _>
                            )
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <local>
                      more_env: []
                      words: [
                        {<local>}
                        {<Id.Lit_VarLike 'lineno='> 
                          (DQ 
                            (CommandSub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Simple
                                  blame_tok: <bats_frame_lineno>
                                  more_env: []
                                  words: [{<bats_frame_lineno>} {(DQ ($ Id.VSub_DollarName frame))}]
                                  redirects: []
                                  do_fork: T
                                )
                              right: <Id.Eof_RParen _>
                            )
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Simple
                                      blame_tok: <Id.Lit_LBracket '['>
                                      more_env: []
                                      words: [
                                        {<Id.Lit_LBracket '['>}
                                        {($ Id.VSub_DollarName index)}
                                        {<-eq>}
                                        {<1>}
                                        {<Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [{<echo>} {<-n>} {(DQ <'# ('>)}]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          spids: [925 938]
                        )
                      ]
                      else_kw: <Id.KW_Else else>
                      else_action: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [{<echo>} {<-n>} {(DQ <'#  '>)}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <local>
                      more_env: []
                      words: [
                        {<local>}
                        {<Id.Lit_VarLike 'fn='> 
                          (DQ 
                            (CommandSub
                              left_token: <Id.Left_DollarParen '$('>
                              child: 
                                (command.Simple
                                  blame_tok: <bats_frame_function>
                                  more_env: []
                                  words: [{<bats_frame_function>} {(DQ ($ Id.VSub_DollarName frame))}]
                                  redirects: []
                                  do_fork: T
                                )
                              right: <Id.Eof_RParen _>
                            )
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Simple
                                      blame_tok: <Id.Lit_LBracket '['>
                                      more_env: []
                                      words: [
                                        {<Id.Lit_LBracket '['>}
                                        {(DQ ($ Id.VSub_DollarName fn))}
                                        {<Id.KW_Bang '!'> <Id.Lit_Equals '='>}
                                        {(DQ ($ Id.VSub_DollarName BATS_TEST_NAME))}
                                        {<Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [
                                {<echo>}
                                {<-n>}
                                {
                                  (DQ <'from function '> 
                                    (word_part.EscapedLiteral
                                      token: <Id.Lit_EscapedChar '\\`'>
                                      ch: '`'
                                    ) ($ Id.VSub_DollarName fn) <'\' '>
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          spids: [980 998]
                        )
                      ]
                      else_action: []
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Simple
                                      blame_tok: <Id.Lit_LBracket '['>
                                      more_env: []
                                      words: [
                                        {<Id.Lit_LBracket '['>}
                                        {($ Id.VSub_DollarName index)}
                                        {<-eq>}
                                        {($ Id.VSub_DollarName count)}
                                        {<Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [
                                {<echo>}
                                {
                                  (DQ <'in test file '> ($ Id.VSub_DollarName filename) <', line '> 
                                    ($ Id.VSub_DollarName lineno) <')'>
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          spids: [1017 1030]
                        )
                      ]
                      else_kw: <Id.KW_Else else>
                      else_action: [
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [
                            {<echo>}
                            {
                              (DQ <'in file '> ($ Id.VSub_DollarName filename) <', line '> 
                                ($ Id.VSub_DollarName lineno) <','>
                              )
                            }
                          ]
                          redirects: []
                          do_fork: T
                        )
                      ]
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <let>
                      more_env: []
                      words: [{<let>} {<Id.Lit_VarLike 'index+='> <1>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_print_failed_command>
      name: bats_print_failed_command
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'frame='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'status='> (DQ ($ Id.VSub_Number 2))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'filename='> 
                  (DQ 
                    (CommandSub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Simple
                          blame_tok: <bats_frame_filename>
                          more_env: []
                          words: [{<bats_frame_filename>} {(DQ ($ Id.VSub_DollarName frame))}]
                          redirects: []
                          do_fork: T
                        )
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'lineno='> 
                  (DQ 
                    (CommandSub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Simple
                          blame_tok: <bats_frame_lineno>
                          more_env: []
                          words: [{<bats_frame_lineno>} {(DQ ($ Id.VSub_DollarName frame))}]
                          redirects: []
                          do_fork: T
                        )
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'failed_line='> 
                  (DQ 
                    (CommandSub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Simple
                          blame_tok: <bats_extract_line>
                          more_env: []
                          words: [
                            {<bats_extract_line>}
                            {(DQ ($ Id.VSub_DollarName filename))}
                            {(DQ ($ Id.VSub_DollarName lineno))}
                          ]
                          redirects: []
                          do_fork: T
                        )
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'failed_command='> 
                  (DQ 
                    (CommandSub
                      left_token: <Id.Left_DollarParen '$('>
                      child: 
                        (command.Simple
                          blame_tok: <bats_strip_string>
                          more_env: []
                          words: [{<bats_strip_string>} {(DQ ($ Id.VSub_DollarName failed_line))}]
                          redirects: []
                          do_fork: T
                        )
                      right: <Id.Eof_RParen _>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [
                {<echo>}
                {<-n>}
                {
                  (DQ <'#   '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\`'> ch:'`') 
                    (${ Id.VSub_Name failed_command) <'\' '>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {($ Id.VSub_DollarName status)}
                                {<-eq>}
                                {<1>}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {(DQ <failed>)}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  spids: [1172 1185]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(DQ <'failed with status '> ($ Id.VSub_DollarName status))}]
                  redirects: []
                  do_fork: T
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_frame_lineno>
      name: bats_frame_lineno
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'frame='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'lineno='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name frame>
                      var_name: frame
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_DPercent '%%'>
                          arg_word: {<' '> <Id.Lit_Other '*'>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ ($ Id.VSub_DollarName lineno))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_frame_function>
      name: bats_frame_function
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'frame='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'rest='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name frame>
                      var_name: frame
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_Pound '#'>
                          arg_word: {<Id.Lit_Other '*'> <' '>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'fn='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name rest>
                      var_name: rest
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_DPercent '%%'>
                          arg_word: {<' '> <Id.Lit_Other '*'>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ ($ Id.VSub_DollarName fn))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_frame_filename>
      name: bats_frame_filename
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'frame='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'rest='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name frame>
                      var_name: frame
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_Pound '#'>
                          arg_word: {<Id.Lit_Other '*'> <' '>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'filename='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name rest>
                      var_name: rest
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_Pound '#'>
                          arg_word: {<Id.Lit_Other '*'> <' '>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {(DQ ($ Id.VSub_DollarName filename))}
                                {<Id.Lit_Equals '='>}
                                {(DQ ($ Id.VSub_DollarName BATS_TEST_SOURCE))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  spids: [1340 1357]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(DQ ($ Id.VSub_DollarName filename))}]
                  redirects: []
                  do_fork: T
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_extract_line>
      name: bats_extract_line
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'filename='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'lineno='> (DQ ($ Id.VSub_Number 2))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-n>}
                {(DQ (${ Id.VSub_Name lineno) <p>)}
                {(DQ ($ Id.VSub_DollarName filename))}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_strip_string>
      name: bats_strip_string
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'string='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Pipeline
              children: [
                (command.Simple
                  blame_tok: <printf>
                  more_env: []
                  words: [{<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_DollarName string))}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <sed>
                  more_env: []
                  words: [
                    {<sed>}
                    {<-e>}
                    {(DQ <'s/^[ '>) 
                      (SingleQuoted
                        left: <Id.Left_DollarSingleQuote '$\''>
                        tokens: [<Id.Char_OneChar '\\t'>]
                        right: <Id.Right_SingleQuote '\''>
                      ) (DQ <']*//'>)
                    }
                    {<-e>}
                    {(DQ <'s/[ '>) 
                      (SingleQuoted
                        left: <Id.Left_DollarSingleQuote '$\''>
                        tokens: [<Id.Char_OneChar '\\t'>]
                        right: <Id.Right_SingleQuote '\''>
                      ) (DQ <']*'> <Id.Lit_Dollar '$'> <'//'>)
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_Pipe _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_trim_filename>
      name: bats_trim_filename
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'filename='> (DQ ($ Id.VSub_Number 1))}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [
                {<local>}
                {<Id.Lit_VarLike 'length='> 
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name BATS_CWD>
                      var_name: BATS_CWD
                      prefix_op: <Id.VSub_Pound '#'>
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name filename>
                                      var_name: filename
                                      suffix_op: 
                                        (suffix_op.Slice
                                          begin: {<Id.Lit_Digits 0>}
                                          length: 
                                            (arith_expr.Binary
                                              op_id: Id.Arith_Plus
                                              left: ($ Id.Lit_ArithVarLike length)
                                              right: {<Id.Lit_Digits 1>}
                                            )
                                        )
                                      right: <Id.Arith_RBrace _>
                                    )
                                  )
                                }
                                {<Id.Lit_Equals '='>}
                                {(DQ (${ Id.VSub_Name BATS_CWD) <'/'>)}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [
                        {<echo>}
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Name filename>
                              var_name: filename
                              suffix_op: 
                                (suffix_op.Slice
                                  begin: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Plus
                                      left: ($ Id.Lit_ArithVarLike length)
                                      right: {<Id.Lit_Digits 1>}
                                    )
                                )
                              right: <Id.Arith_RBrace _>
                            )
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  spids: [1508 1536]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [{<echo>} {(DQ ($ Id.VSub_DollarName filename))}]
                  redirects: []
                  do_fork: T
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_debug_trap>
      name: bats_debug_trap
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {(DQ ($ Id.VSub_DollarName BASH_SOURCE))}
                                {<Id.KW_Bang '!'> <Id.Lit_Equals '='>}
                                {(DQ ($ Id.VSub_Number 1))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <bats_capture_stack_trace>
                      more_env: []
                      words: [{<bats_capture_stack_trace>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  spids: [1574 1592]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_error_trap>
      name: bats_error_trap
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
                      name: BATS_ERROR_STATUS
                    )
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_QMark '?'))}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
                      name: BATS_ERROR_STACK_TRACE
                    )
                  op: assign_op.Equal
                  rhs: 
                    {
                      (ShArrayLiteral
                        left: <Id.Op_LParen _>
                        words: [
                          {
                            (DQ 
                              (BracedVarSub
                                left: <Id.Left_DollarBrace '${'>
                                token: <Id.VSub_Name BATS_PREVIOUS_STACK_TRACE>
                                var_name: BATS_PREVIOUS_STACK_TRACE
                                bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                right: <Id.Right_DollarBrace '}'>
                              )
                            )
                          }
                        ]
                        right: <Id.Right_ShArrayLiteral _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <trap>
              more_env: []
              words: [{<trap>} {<->} {<debug>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_teardown_trap>
      name: bats_teardown_trap
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <trap>
              more_env: []
              words: [{<trap>} {(DQ <bats_exit_trap>)} {<Id.ControlFlow_Exit exit>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<Id.Lit_VarLike 'status='> <0>}]
              redirects: []
              do_fork: T
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <teardown>
                  more_env: []
                  words: [{<teardown>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_DGreat '>>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName BATS_OUT))}
                    )
                    (Redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                  ]
                  do_fork: T
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'status='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'status='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                      op: assign_op.Equal
                      rhs: {(DQ ($ Id.VSub_QMark '?'))}
                    )
                  ]
                  redirects: []
                )
              ]
              ops: [<Id.Op_DPipe _>]
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {($ Id.VSub_DollarName status)}
                                {<-eq>}
                                {<0>}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                              name: BATS_TEARDOWN_COMPLETED
                            )
                          op: assign_op.Equal
                          rhs: {<1>}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1681 1694]
                )
                (IfArm
                  keyword: <Id.KW_Elif elif>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {<-n>}
                                {(DQ ($ Id.VSub_DollarName BATS_TEST_COMPLETED))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_ERROR_STATUS='>
                              name: BATS_ERROR_STATUS
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_DollarName status))}
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_ERROR_STACK_TRACE='>
                              name: BATS_ERROR_STACK_TRACE
                            )
                          op: assign_op.Equal
                          rhs: 
                            {
                              (ShArrayLiteral
                                left: <Id.Op_LParen _>
                                words: [
                                  {
                                    (DQ 
                                      (BracedVarSub
                                        left: <Id.Left_DollarBrace '${'>
                                        token: <Id.VSub_Name BATS_CURRENT_STACK_TRACE>
                                        var_name: BATS_CURRENT_STACK_TRACE
                                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                        right: <Id.Right_DollarBrace '}'>
                                      )
                                    )
                                  }
                                ]
                                right: <Id.Right_ShArrayLiteral _>
                              )
                            }
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1701 1714]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <bats_exit_trap>
              more_env: []
              words: [{<bats_exit_trap>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_exit_trap>
      name: bats_exit_trap
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<status>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <local>
              more_env: []
              words: [{<local>} {<skipped>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <trap>
              more_env: []
              words: [{<trap>} {<->} {<err>} {<Id.ControlFlow_Exit exit>}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'skipped='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'skipped='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'skipped='> name:skipped)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                )
              ]
              redirects: []
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {<-n>}
                                {(DQ ($ Id.VSub_DollarName BATS_TEST_SKIPPED))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'skipped='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'skipped='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'skipped='> name:skipped)
                          op: assign_op.Equal
                          rhs: {(DQ <' # skip'>)}
                        )
                      ]
                      redirects: []
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Simple
                                      blame_tok: <Id.Lit_LBracket '['>
                                      more_env: []
                                      words: [
                                        {<Id.Lit_LBracket '['>}
                                        {(DQ <1>)}
                                        {<Id.KW_Bang '!'> <Id.Lit_Equals '='>}
                                        {(DQ ($ Id.VSub_DollarName BATS_TEST_SKIPPED))}
                                        {<Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.ShAssignment
                              left: <Id.Lit_VarLike 'skipped+='>
                              pairs: [
                                (AssignPair
                                  left: <Id.Lit_VarLike 'skipped+='>
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'skipped+='>
                                      name: skipped
                                    )
                                  op: assign_op.PlusEqual
                                  rhs: {(DQ <' ('> ($ Id.VSub_DollarName BATS_TEST_SKIPPED) <')'>)}
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [1801 1819]
                        )
                      ]
                      else_action: []
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                  ]
                  spids: [1779 1792]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              children: [
                                (command.Simple
                                  blame_tok: <Id.Lit_LBracket '['>
                                  more_env: []
                                  words: [
                                    {<Id.Lit_LBracket '['>}
                                    {<-z>}
                                    {(DQ ($ Id.VSub_DollarName BATS_TEST_COMPLETED))}
                                    {<Id.Lit_RBracket ']'>}
                                  ]
                                  redirects: []
                                  do_fork: T
                                )
                                (command.Simple
                                  blame_tok: <Id.Lit_LBracket '['>
                                  more_env: []
                                  words: [
                                    {<Id.Lit_LBracket '['>}
                                    {<-z>}
                                    {(DQ ($ Id.VSub_DollarName BATS_TEARDOWN_COMPLETED))}
                                    {<Id.Lit_RBracket ']'>}
                                  ]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                              ops: [<Id.Op_DPipe _>]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [
                        {<echo>}
                        {
                          (DQ <'not ok '> ($ Id.VSub_DollarName BATS_TEST_NUMBER) <' '> 
                            ($ Id.VSub_DollarName BATS_TEST_DESCRIPTION)
                          )
                        }
                      ]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<3>})]
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <bats_print_stack_trace>
                      more_env: []
                      words: [
                        {<bats_print_stack_trace>}
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Name BATS_ERROR_STACK_TRACE>
                              var_name: BATS_ERROR_STACK_TRACE
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              right: <Id.Right_DollarBrace '}'>
                            )
                          )
                        }
                      ]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<3>})]
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <bats_print_failed_command>
                      more_env: []
                      words: [
                        {<bats_print_failed_command>}
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Name BATS_ERROR_STACK_TRACE>
                              var_name: BATS_ERROR_STACK_TRACE
                              bracket_op: 
                                (bracket_op.ArrayIndex
                                  expr: 
                                    (arith_expr.Binary
                                      op_id: Id.Arith_Minus
                                      left: 
                                        {
                                          (BracedVarSub
                                            left: <Id.Left_DollarBrace '${'>
                                            token: <Id.VSub_Name BATS_ERROR_STACK_TRACE>
                                            var_name: BATS_ERROR_STACK_TRACE
                                            prefix_op: <Id.VSub_Pound '#'>
                                            bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                            right: <Id.Right_DollarBrace '}'>
                                          )
                                        }
                                      right: {<Id.Lit_Digits 1>}
                                    )
                                )
                              right: <Id.Right_DollarBrace '}'>
                            )
                          )
                        }
                        {(DQ ($ Id.VSub_DollarName BATS_ERROR_STATUS))}
                      ]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<3>})]
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <sed>
                      more_env: []
                      words: [{<sed>} {<-e>} {(DQ <'s/^/# /'>)}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_Less '<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: {(DQ ($ Id.VSub_DollarName BATS_OUT))}
                        )
                        (Redir
                          op: <Id.Redir_GreatAnd '>&'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {<3>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'status='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'status='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                          op: assign_op.Equal
                          rhs: {<1>}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [1837 1862]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [
                    {<echo>}
                    {
                      (DQ <'ok '> (${ Id.VSub_Name BATS_TEST_NUMBER) (${ Id.VSub_Name skipped) <' '> 
                        (${ Id.VSub_Name BATS_TEST_DESCRIPTION)
                      )
                    }
                  ]
                  redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<3>})]
                  do_fork: T
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'status='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'status='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                      op: assign_op.Equal
                      rhs: {<0>}
                    )
                  ]
                  redirects: []
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <rm>
              more_env: []
              words: [{<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName BATS_OUT))}]
              redirects: []
              do_fork: T
            )
            (command.ControlFlow
              keyword: <Id.ControlFlow_Exit exit>
              arg_word: {(DQ ($ Id.VSub_DollarName status))}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_perform_tests>
      name: bats_perform_tests
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <echo>
              more_env: []
              words: [{<echo>} {(DQ <1..> ($ Id.VSub_Pound '#'))}]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'test_number='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'test_number='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_number='> name:test_number)
                  op: assign_op.Equal
                  rhs: {<1>}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'status='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'status='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                  op: assign_op.Equal
                  rhs: {<0>}
                )
              ]
              redirects: []
            )
            (command.ForEach
              keyword: <Id.KW_For for>
              iter_names: [test_name]
              iterable: (for_iter.Words words:[{(DQ ($ Id.VSub_At '@'))}])
              semi_tok: <Id.Op_Semi _>
              body: 
                (command.DoGroup
                  left: <Id.KW_Do do>
                  children: [
                    (command.AndOr
                      children: [
                        (command.Simple
                          blame_tok: <Id.Left_DoubleQuote '"'>
                          more_env: []
                          words: [
                            {(DQ ($ Id.VSub_Number 0))}
                            {($ Id.VSub_DollarName BATS_EXTENDED_SYNTAX)}
                            {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}
                            {(DQ ($ Id.VSub_DollarName test_name))}
                            {(DQ ($ Id.VSub_DollarName test_number))}
                          ]
                          redirects: []
                          do_fork: T
                        )
                        (command.ShAssignment
                          left: <Id.Lit_VarLike 'status='>
                          pairs: [
                            (AssignPair
                              left: <Id.Lit_VarLike 'status='>
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
                              op: assign_op.Equal
                              rhs: {<1>}
                            )
                          ]
                          redirects: []
                        )
                      ]
                      ops: [<Id.Op_DPipe _>]
                    )
                    (command.Simple
                      blame_tok: <let>
                      more_env: []
                      words: [{<let>} {<Id.Lit_VarLike 'test_number+='> <1>}]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  right: <Id.KW_Done done>
                )
              redirects: []
            )
            (command.ControlFlow
              keyword: <Id.ControlFlow_Exit exit>
              arg_word: {(DQ ($ Id.VSub_DollarName status))}
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_perform_test>
      name: bats_perform_test
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TEST_NAME='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TEST_NAME='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TEST_NAME='> name:BATS_TEST_NAME)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                )
              ]
              redirects: []
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {
                                  (DQ 
                                    (CommandSub
                                      left_token: <Id.Left_DollarParen '$('>
                                      child: 
                                        (command.AndOr
                                          children: [
                                            (command.Simple
                                              blame_tok: <type>
                                              more_env: []
                                              words: [
                                                {<type>}
                                                {<-t>}
                                                {(DQ ($ Id.VSub_DollarName BATS_TEST_NAME))}
                                              ]
                                              redirects: []
                                              do_fork: T
                                            )
                                            (command.Simple
                                              blame_tok: <true>
                                              more_env: []
                                              words: [{<true>}]
                                              redirects: []
                                              do_fork: T
                                            )
                                          ]
                                          ops: [<Id.Op_DPipe _>]
                                        )
                                      right: <Id.Eof_RParen _>
                                    )
                                  )
                                }
                                {<Id.Lit_Equals '='>}
                                {(DQ <function>)}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                              name: BATS_TEST_NUMBER
                            )
                          op: assign_op.Equal
                          rhs: {(DQ ($ Id.VSub_Number 2))}
                        )
                      ]
                      redirects: []
                    )
                    (command.If
                      if_kw: <Id.KW_If if>
                      arms: [
                        (IfArm
                          keyword: <Id.KW_If if>
                          cond: 
                            (condition.Shell
                              commands: [
                                (command.Sentence
                                  child: 
                                    (command.Simple
                                      blame_tok: <Id.Lit_LBracket '['>
                                      more_env: []
                                      words: [
                                        {<Id.Lit_LBracket '['>}
                                        {<-z>}
                                        {(DQ ($ Id.VSub_DollarName BATS_TEST_NUMBER))}
                                        {<Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  terminator: <Id.Op_Semi _>
                                )
                              ]
                            )
                          then_kw: <Id.KW_Then then>
                          action: [
                            (command.Simple
                              blame_tok: <echo>
                              more_env: []
                              words: [{<echo>} {(DQ <1..1>)}]
                              redirects: []
                              do_fork: T
                            )
                            (command.ShAssignment
                              left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                              pairs: [
                                (AssignPair
                                  left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                                  lhs: 
                                    (sh_lhs_expr.Name
                                      left: <Id.Lit_VarLike 'BATS_TEST_NUMBER='>
                                      name: BATS_TEST_NUMBER
                                    )
                                  op: assign_op.Equal
                                  rhs: {(DQ <1>)}
                                )
                              ]
                              redirects: []
                            )
                          ]
                          spids: [2121 2134]
                        )
                      ]
                      else_action: []
                      fi_kw: <Id.KW_Fi fi>
                      redirects: []
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                              name: BATS_TEST_COMPLETED
                            )
                          op: assign_op.Equal
                          rhs: {(DQ )}
                        )
                      ]
                      redirects: []
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEARDOWN_COMPLETED='>
                              name: BATS_TEARDOWN_COMPLETED
                            )
                          op: assign_op.Equal
                          rhs: {(DQ )}
                        )
                      ]
                      redirects: []
                    )
                    (command.Simple
                      blame_tok: <trap>
                      more_env: []
                      words: [
                        {<trap>}
                        {
                          (DQ <'bats_debug_trap '> 
                            (word_part.EscapedLiteral
                              token: <Id.Lit_EscapedChar '\\"'>
                              ch: '"'
                            ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <BASH_SOURCE> 
                            (word_part.EscapedLiteral
                              token: <Id.Lit_EscapedChar '\\"'>
                              ch: '"'
                            )
                          )
                        }
                        {<debug>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <trap>
                      more_env: []
                      words: [{<trap>} {(DQ <bats_error_trap>)} {<err>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <trap>
                      more_env: []
                      words: [{<trap>} {(DQ <bats_teardown_trap>)} {<Id.ControlFlow_Exit exit>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <Id.Left_DoubleQuote '"'>
                      more_env: []
                      words: [{(DQ ($ Id.VSub_DollarName BATS_TEST_NAME))}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_DGreat '>>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ ($ Id.VSub_DollarName BATS_OUT))}
                        )
                        (Redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                      ]
                      do_fork: T
                    )
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEST_COMPLETED='>
                              name: BATS_TEST_COMPLETED
                            )
                          op: assign_op.Equal
                          rhs: {<1>}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [2083 2112]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <echo>
                  more_env: []
                  words: [
                    {<echo>}
                    {
                      (DQ <'bats: unknown test name '> 
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\`'>
                          ch: '`'
                        ) ($ Id.VSub_DollarName BATS_TEST_NAME) <'\''>
                      )
                    }
                  ]
                  redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
                  do_fork: T
                )
                (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {<-z>}
                        {(DQ ($ Id.VSub_DollarName TMPDIR))}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TMPDIR='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TMPDIR='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TMPDIR='> name:BATS_TMPDIR)
                  op: assign_op.Equal
                  rhs: {(DQ <'/tmp'>)}
                )
              ]
              redirects: []
            )
          ]
          spids: [2239 2252]
        )
      ]
      else_kw: <Id.KW_Else else>
      else_action: [
        (command.ShAssignment
          left: <Id.Lit_VarLike 'BATS_TMPDIR='>
          pairs: [
            (AssignPair
              left: <Id.Lit_VarLike 'BATS_TMPDIR='>
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TMPDIR='> name:BATS_TMPDIR)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_Name TMPDIR>
                      var_name: TMPDIR
                      suffix_op: 
                        (suffix_op.Unary
                          op: <Id.VOp1_Percent '%'>
                          arg_word: {<Id.Lit_Slash '/'>}
                        )
                      right: <Id.Right_DollarBrace '}'>
                    )
                  )
                }
            )
          ]
          redirects: []
        )
      ]
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_TMPNAME='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_TMPNAME='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_TMPNAME='> name:BATS_TMPNAME)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName BATS_TMPDIR) <'/bats.'> ($ Id.VSub_Dollar '$'))}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_PARENT_TMPNAME='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_PARENT_TMPNAME='>
          lhs: 
            (sh_lhs_expr.Name
              left: <Id.Lit_VarLike 'BATS_PARENT_TMPNAME='>
              name: BATS_PARENT_TMPNAME
            )
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName BATS_TMPDIR) <'/bats.'> ($ Id.VSub_DollarName PPID))}
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'BATS_OUT='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'BATS_OUT='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'BATS_OUT='> name:BATS_OUT)
          op: assign_op.Equal
          rhs: {(DQ (${ Id.VSub_Name BATS_TMPNAME) <.out>)}
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <bats_preprocess_source>
      name: bats_preprocess_source
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
                  lhs: 
                    (sh_lhs_expr.Name
                      left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
                      name: BATS_TEST_SOURCE
                    )
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Name BATS_TMPNAME) <.src>)}
                )
              ]
              redirects: []
            )
            (command.Pipeline
              children: [
                (BraceGroup
                  left: <Id.Lit_LBrace '{'>
                  children: [
                    (command.Sentence
                      child: 
                        (command.Simple
                          blame_tok: <tr>
                          more_env: []
                          words: [{<tr>} {<-d>} {(SQ <'\\r'>)}]
                          redirects: [
                            (Redir
                              op: <Id.Redir_Less '<'>
                              loc: (redir_loc.Fd fd:0)
                              arg: {(DQ ($ Id.VSub_DollarName BATS_TEST_FILENAME))}
                            )
                          ]
                          do_fork: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                    (command.Sentence
                      child: 
                        (command.Simple
                          blame_tok: <echo>
                          more_env: []
                          words: [{<echo>}]
                          redirects: []
                          do_fork: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  redirects: []
                  right: <Id.Lit_RBrace '}'>
                )
                (command.Simple
                  blame_tok: <bats-preprocess>
                  more_env: []
                  words: [{<bats-preprocess>}]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ ($ Id.VSub_DollarName BATS_TEST_SOURCE))}
                    )
                  ]
                  do_fork: T
                )
              ]
              ops: [<Id.Op_Pipe _>]
            )
            (command.Simple
              blame_tok: <trap>
              more_env: []
              words: [
                {<trap>}
                {(DQ <bats_cleanup_preprocessed_source>)}
                {<err>}
                {<Id.ControlFlow_Exit exit>}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <trap>
              more_env: []
              words: [{<trap>} {(DQ <'bats_cleanup_preprocessed_source; exit 1'>)} {<int>}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_cleanup_preprocessed_source>
      name: bats_cleanup_preprocessed_source
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <rm>
              more_env: []
              words: [{<rm>} {<-f>} {(DQ ($ Id.VSub_DollarName BATS_TEST_SOURCE))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <bats_evaluate_preprocessed_source>
      name: bats_evaluate_preprocessed_source
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {<-z>}
                                {(DQ ($ Id.VSub_DollarName BATS_TEST_SOURCE))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
                          lhs: 
                            (sh_lhs_expr.Name
                              left: <Id.Lit_VarLike 'BATS_TEST_SOURCE='>
                              name: BATS_TEST_SOURCE
                            )
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name BATS_PARENT_TMPNAME) <.src>)}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [2394 2407]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <source>
              more_env: []
              words: [{<source>} {(DQ ($ Id.VSub_DollarName BATS_TEST_SOURCE))}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <exec>
      more_env: []
      words: [{<exec>}]
      redirects: [(Redir op:<Id.Redir_LessAnd '3<&'> loc:(redir_loc.Fd fd:3) arg:{<1>})]
      do_fork: T
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.Simple
                      blame_tok: <Id.Lit_LBracket '['>
                      more_env: []
                      words: [
                        {<Id.Lit_LBracket '['>}
                        {(DQ ($ Id.VSub_Pound '#'))}
                        {<-eq>}
                        {<0>}
                        {<Id.Lit_RBracket ']'>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <bats_preprocess_source>
              more_env: []
              words: [{<bats_preprocess_source>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <bats_evaluate_preprocessed_source>
              more_env: []
              words: [{<bats_evaluate_preprocessed_source>}]
              redirects: []
              do_fork: T
            )
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Simple
                              blame_tok: <Id.Lit_LBracket '['>
                              more_env: []
                              words: [
                                {<Id.Lit_LBracket '['>}
                                {<-n>}
                                {(DQ ($ Id.VSub_DollarName BATS_COUNT_ONLY))}
                                {<Id.Lit_RBracket ']'>}
                              ]
                              redirects: []
                              do_fork: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [
                        {<echo>}
                        {
                          (DQ 
                            (BracedVarSub
                              left: <Id.Left_DollarBrace '${'>
                              token: <Id.VSub_Name BATS_TEST_NAMES>
                              var_name: BATS_TEST_NAMES
                              prefix_op: <Id.VSub_Pound '#'>
                              bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                              right: <Id.Right_DollarBrace '}'>
                            )
                          )
                        }
                      ]
                      redirects: []
                      do_fork: T
                    )
                  ]
                  spids: [2462 2475]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.Simple
                  blame_tok: <bats_perform_tests>
                  more_env: []
                  words: [
                    {<bats_perform_tests>}
                    {
                      (DQ 
                        (BracedVarSub
                          left: <Id.Left_DollarBrace '${'>
                          token: <Id.VSub_Name BATS_TEST_NAMES>
                          var_name: BATS_TEST_NAMES
                          bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                          right: <Id.Right_DollarBrace '}'>
                        )
                      )
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
          ]
          spids: [2437 2452]
        )
      ]
      else_kw: <Id.KW_Else else>
      else_action: [
        (command.Simple
          blame_tok: <bats_evaluate_preprocessed_source>
          more_env: []
          words: [{<bats_evaluate_preprocessed_source>}]
          redirects: []
          do_fork: T
        )
        (command.Simple
          blame_tok: <bats_perform_test>
          more_env: []
          words: [{<bats_perform_test>} {(DQ ($ Id.VSub_At '@'))}]
          redirects: []
          do_fork: T
        )
      ]
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
  ]
)