(command.CommandList children: [ (C {(cd)} { (braced_var_sub token: (Token id:Id.VSub_Number val:0 span_id:7) suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{(Id.Lit_Slash /) ('*')}) ) } ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:fails) op:assign_op.Equal rhs:{(0)} spids:[21])] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tests) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:25) command_list: (command.CommandList children: [ (command.Pipeline children: [(C {(ls)} {(invalid/) (Id.Lit_Star '*')}) (C {(wc)} {(-l)})] negated: F ) ] ) ) } spids: [24] ) ] ) (C {(echo)} { (DQ (1..) (braced_var_sub token: (Token id:Id.VSub_Name val:tests span_id:46) suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{('* ')}) ) ) } ) (command.ForEach iter_name: input iter_words: [{(invalid/) (Id.Lit_Star '*')}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:i) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:i span_id:66) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [64] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Simple words: [{(../JSON.sh)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:77) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$input'))} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:83) fd: -1 arg_word: {(/tmp/JSON.sh_outlog)} ) (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:87) fd: 2 arg_word: {(/tmp/JSON.sh_errlog)} ) ] ) ] action: [ (C {(echo)} { (DQ ('not ok ') ($ Id.VSub_DollarName '$i') (' - cat ') ($ Id.VSub_DollarName '$input') (' | ../JSON.sh should fail') ) } ) (C {(echo)} {(DQ ('OUTPUT WAS >>>'))}) (C {(cat)} {(/tmp/JSON.sh_outlog)}) (C {(echo)} {(DQ ('<<<'))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fails) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:fails span_id:132) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [130] ) ] ) ] spids: [73 93] ) ] else_action: [ (C {(echo)} { (DQ ('ok ') ($ Id.VSub_DollarName '$i') (' - ') ($ Id.VSub_DollarName '$input') (' was rejected') ) } ) (C {(echo)} {(DQ ('#'))} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:159) command_list: (command.CommandList children: [(C {(cat)} {(/tmp/JSON.sh_errlog)})] ) ) } ) ] ) ] ) ) (C {(echo)} {(DQ ($ Id.VSub_DollarName '$fails') (' test(s) failed'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:179) arg_word: {($ Id.VSub_DollarName '$fails')} ) ] )