(CommandList
  children: [
    (C {(cd)} 
      {
        (BracedVarSub
          token: <VSub_Number 0>
          suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')})
          spids: [6 11]
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:fails) op:Equal rhs:{(0)} spids:[21])]
      spids: [21]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:tests)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [(C {(ls)} {(invalid/) (Lit_Other '*')}) (C {(wc)} {(-l)})]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [25 36]
              )
            }
          spids: [24]
        )
      ]
      spids: [24]
    )
    (C {(echo)} 
      {
        (DQ (1..) 
          (BracedVarSub
            token: <VSub_Name tests>
            suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{('* ')})
            spids: [43 47]
          )
        )
      }
    )
    (ForEach
      iter_name: input
      iter_words: [{(invalid/) (Lit_Other '*')}]
      do_arg_iter: F
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:i)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithVarRef name:i)
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [63 68]
                      )
                    }
                  spids: [62]
                )
              ]
              spids: [62]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (SimpleCommand
                      words: [{(../JSON.sh)}]
                      redirects: [
                        (Redir
                          op: <Redir_Less '<'>
                          fd: 16777215
                          arg_word: {(DQ ($ VSub_Name '$input'))}
                        )
                        (Redir
                          op: <Redir_Great '>'>
                          fd: 16777215
                          arg_word: {(/tmp/JSON.sh_outlog)}
                        )
                        (Redir
                          op: <Redir_Great '2>'>
                          fd: 2
                          arg_word: {(/tmp/JSON.sh_errlog)}
                        )
                      ]
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ('not ok ') ($ VSub_Name '$i') (' - cat ') ($ VSub_Name '$input') 
                          (' | ../JSON.sh should fail')
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('OUTPUT WAS >>>'))})
                    (C {(cat)} {(/tmp/JSON.sh_outlog)})
                    (C {(echo)} {(DQ ('<<<'))})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:fails)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Plus
                                    left: (ArithVarRef name:fails)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [129 134]
                              )
                            }
                          spids: [128]
                        )
                      ]
                      spids: [128]
                    )
                  ]
                  spids: [16777215 91]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {(DQ ('ok ') ($ VSub_Name '$i') (' - ') ($ VSub_Name '$input') (' was rejected'))}
                )
                (C {(echo)} {(DQ ('#'))} 
                  {
                    (CommandSubPart
                      command_list: (CommandList children:[(C {(cat)} {(/tmp/JSON.sh_errlog)})])
                      left_token: <Left_Backtick '`'>
                      spids: [157 161]
                    )
                  }
                )
              ]
              spids: [137 164]
            )
          ]
          spids: [59 166]
        )
      spids: [55 16777215]
    )
    (C {(echo)} {(DQ ($ VSub_Name '$fails') (' test(s) failed'))})
    (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_Name '$fails')})
  ]
)