(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: False
                      )
                    ]
                  )
                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: False
      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_id: Redir_Less
                          fd: -1
                          arg_word: {(DQ ($ VSub_Name "$input"))}
                          spids: [75]
                        )
                        (Redir
                          op_id: Redir_Great
                          fd: -1
                          arg_word: {(/tmp/JSON.sh_outlog)}
                          spids: [81]
                        )
                        (Redir
                          op_id: Redir_Great
                          fd: 2
                          arg_word: {(/tmp/JSON.sh_errlog)}
                          spids: [85]
                        )
                      ]
                    )
                  ]
                  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: [-1 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 -1]
    )
    (C {(echo)} {(DQ ($ VSub_Name "$fails") (" test(s) failed"))})
    (C {(exit)} {($ VSub_Name "$fails")})
  ]
)