(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:fail) op:assign_op.Equal rhs:{(0)} spids:[17])] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:tests) op:assign_op.Equal rhs:{(0)} spids:[20])] ) (command.ForEach iter_name: test iter_words: [{(test/) (Id.Lit_Star '*') (.sh)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:tests) 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:tests span_id:46) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [44] ) ] ) (C {(echo)} {(TEST) (Id.Lit_Other ':')} {($ Id.VSub_DollarName '$test')}) (C {(./) ($ Id.VSub_DollarName '$test')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [65] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:81) ) ] action: [ (C {(echo)} {(OK) (Id.Lit_Other ':')} {(----)} {($ Id.VSub_DollarName '$test')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:passed) 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:passed span_id:98) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [96] ) ] ) ] spids: [69 83] ) ] else_action: [ (C {(echo)} {(FAIL) (Id.Lit_Other ':')} {($ Id.VSub_DollarName '$test')} {($ Id.VSub_DollarName '$fail')} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fail) 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:fail span_id:120) ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:ret span_id:122) ) ) ) } spids: [118] ) ] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$fail')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:143) ) ] action: [ (C {(echo)} {(-n)} {(SQ (Token id:Id.Lit_Chars val:'SUCCESS ' span_id:153))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:exitcode) op: assign_op.Equal rhs: {(0)} spids: [157] ) ] ) ] spids: [132 145] ) ] else_action: [ (C {(echo)} {(-n)} {(SQ (Token id:Id.Lit_Chars val:'FAILURE ' span_id:168))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:exitcode) op: assign_op.Equal rhs: {(1)} spids: [172] ) ] ) ] ) (C {(echo)} {($ Id.VSub_DollarName '$passed')} {(/)} {($ Id.VSub_DollarName '$tests')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:185) arg_word: {($ Id.VSub_DollarName '$exitcode')} ) ] )