(CommandList children: [ (Sentence child:(C {(set)} {(-u)}) terminator:<Op_Semi ';'>) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} { (BracedVarSub token: <VSub_Name COMMON_SH> suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(true)}) spids: [27 31] ) } {(Lit_Other ']')} ) (ControlFlow token:<ControlFlow_Return return>) ] ) (Assignment keyword: Assign_Declare flags: [-g] pairs: [(assign_pair lhs:(LhsName name:COMMON_SH) op:Equal rhs:{(true)} spids:[43])] spids: [39] ) (FuncDef name: stderr body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ (${ VSub_At '@'))}] redirects: [(Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[68])] ) ] spids: [57] ) spids: [51 56] ) (FuncDef name: functionExists body: (BraceGroup children: [ (Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (LhsName name:functionName) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [85] ) ] spids: [83] ) (Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (LhsName name:type) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(type)} {(-t)} {(DQ (${ VSub_Name functionName))})] ) left_token: <Left_CommandSub '$('> spids: [97 107] ) } spids: [96] ) ] spids: [94] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {($ VSub_QMark '$?')} right: {(0)} ) ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})] spids: [16777215 123] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$type')} right: {(DQ (function))} ) ) terminator: <Op_Semi ';'> ) ] action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] spids: [135 150] ) ] else_action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})] spids: [158 166] ) ] spids: [80] ) spids: [74 79] ) (Assignment keyword: Assign_Declare flags: [-g -A] pairs: [ (assign_pair lhs: (LhsName name:ASSERT_RESULTS) op: Equal rhs: { (ArrayLiteralPart words: [ {(Lit_Other '[') (total) (Lit_Other ']') (Lit_Other '=') (0)} {(Lit_Other '[') (passed) (Lit_Other ']') (Lit_Other '=') (0)} {(Lit_Other '[') (failed) (Lit_Other ']') (Lit_Other '=') (0)} ] ) } spids: [177] ) ] spids: [171] ) (FuncDef name: 'assert::equals' body: (BraceGroup children: [ (Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (LhsName name:expect) op: Equal rhs: {($ VSub_Number '$1')} spids: [213] ) ] spids: [211] ) (Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (LhsName name:actual) op: Equal rhs: {($ VSub_Number '$2')} spids: [219] ) ] spids: [217] ) (Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (LhsName name:message) op: Equal rhs: { (BracedVarSub token: <VSub_At '@'> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 3)})) spids: [226 230] ) } spids: [225] ) ] spids: [223] ) (DParen child: (BinaryAssign op_id: Arith_PlusEqual left: (LhsIndexedName name:ASSERT_RESULTS index:(ArithVarRef name:total)) right: (ArithWord w:{(Lit_Digits 1)}) ) ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$expect'))} {(KW_Bang '!') (Lit_Other '=')} {(DQ ($ VSub_Name '$actual'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ("FAILED ('") ($ VSub_Name '$expect') ("' != '") ($ VSub_Name '$actual') ("') ") ($ VSub_Name '$message') ) } ) (C {(log)} { (DQ ("FAILED ('") ($ VSub_Name '$expect') ("' != '") ($ VSub_Name '$actual') ("') ") ($ VSub_Name '$message') ) } ) (DParen child: (BinaryAssign op_id: Arith_PlusEqual left: (LhsIndexedName name:ASSERT_RESULTS index:(ArithVarRef name:failed)) right: (ArithWord w:{(Lit_Digits 1)}) ) ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [16777215 264] ) ] spids: [16777215 309] ) (C {(echo)} {(DQ ('PASSED ') ($ VSub_Name '$message'))}) (DParen child: (BinaryAssign op_id: Arith_PlusEqual left: (LhsIndexedName name:ASSERT_RESULTS index:(ArithVarRef name:passed)) right: (ArithWord w:{(Lit_Digits 1)}) ) ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [208] ) spids: [199 207] ) (FuncDef name: 'assert::report' body: (BraceGroup children: [ (C {(echo)} { (DQ ('TESTS [total=') (BracedVarSub token: <VSub_Name ASSERT_RESULTS> bracket_op: (ArrayIndex expr:(ArithVarRef name:total)) spids: [356 361] ) ('] [passed=') (BracedVarSub token: <VSub_Name ASSERT_RESULTS> bracket_op: (ArrayIndex expr:(ArithVarRef name:passed)) spids: [363 368] ) ('] [failed=') (BracedVarSub token: <VSub_Name ASSERT_RESULTS> bracket_op: (ArrayIndex expr:(ArithVarRef name:failed)) spids: [370 375] ) (']') ) } ) ] spids: [349] ) spids: [340 348] ) ] )