(CommandList children: [ (C {(set)} {(-e)}) (FuncDef name: version body: (BraceGroup children:[(C {(echo)} {(DQ ("Bats 0.4.0"))})] spids:[12]) spids: [8 11] ) (FuncDef name: usage body: (BraceGroup children: [ (C {(version)}) (C {(echo)} {(DQ ("Usage: bats [-c] [-p | -t] <test> [<test> ...]"))}) ] spids: [28] ) spids: [24 27] ) (FuncDef name: help body: (BraceGroup children: [ (C {(usage)}) (C {(echo)}) (C {(echo)} {(DQ (" <test> is the path to a Bats test file, or the path to a directory"))}) (C {(echo)} {(DQ (" containing Bats test files."))}) (C {(echo)}) (C {(echo)} {(DQ (" -c, --count Count the number of test cases without running any tests"))} ) (C {(echo)} {(DQ (" -h, --help Display this help message"))}) (C {(echo)} {(DQ (" -p, --pretty Show results in pretty format (default for terminals)"))} ) (C {(echo)} {(DQ (" -t, --tap Show results in TAP format"))}) (C {(echo)} {(DQ (" -v, --version Display the version number"))}) (C {(echo)}) (C {(echo)} {(DQ (" For more information, see https://github.com/sstephenson/bats"))}) (C {(echo)}) ] spids: [47] ) spids: [43 46] ) (FuncDef name: resolve_link body: (BraceGroup children: [ (C { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(type)} {(-p)} {(greadlink)} {(readlink)}) (C {(head)} {(-1)})] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [130 144] ) } {(DQ ($ VSub_Number "$1"))} ) ] spids: [127] ) spids: [123 126] ) (FuncDef name: abs_dirname body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cwd) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub "$("> spids: [164 166] ) ) } spids: [162] ) ] spids: [160] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [172] ) ] spids: [170] ) (While cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$path"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (C {(cd)} { (DQ (BracedVarSub token: <VSub_Name path> suffix_op: (StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ("*")}) spids: [198 203] ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name path> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {("*") (Lit_Slash /)} ) spids: [211 216] ) ) } spids: [209] ) ] spids: [207] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(resolve_link)} {(DQ ($ VSub_Name "$name"))}) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [222 232] ) ) } spids: [220] ) ] spids: [220] ) ] spids: [192 236] ) ) (C {(pwd)}) (C {(cd)} {(DQ ($ VSub_Name "$cwd"))}) ] spids: [157] ) spids: [153 156] ) (FuncDef name: expand_path body: (BraceGroup children: [ (AndOr children: [ (BraceGroup children: [ (SimpleCommand words: [ {(cd)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ ($ VSub_Number "$1"))})] ) left_token: <Left_CommandSub "$("> spids: [264 270] ) ) } ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[273])] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:dirname) op: Equal rhs: {(DQ ($ VSub_Name "$PWD"))} spids: [279] ) ] spids: [277] ) (C {(cd)} {(DQ ($ VSub_Name "$OLDPWD"))}) (C {(echo)} { (DQ ($ VSub_Name "$dirname") (/) (CommandSubPart command_list: (CommandList children: [(C {(basename)} {(DQ ($ VSub_Number "$1"))})] ) left_token: <Left_CommandSub "$("> spids: [297 303] ) ) } ) ] spids: [259] ) (C {(echo)} {(DQ ($ VSub_Number "$1"))}) ] op_id: Op_DPipe ) ] spids: [256] ) spids: [252 255] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BATS_LIBEXEC) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(abs_dirname)} {(DQ ($ VSub_Number "$0"))})] ) left_token: <Left_CommandSub "$("> spids: [322 328] ) ) } spids: [320] ) ] spids: [320] ) (C {(export)} {(Lit_VarLike "BATS_PREFIX=") (DQ (CommandSubPart command_list: (CommandList children: [(C {(abs_dirname)} {(DQ ($ VSub_Name "$BATS_LIBEXEC"))})] ) left_token: <Left_CommandSub "$("> spids: [335 341] ) ) } ) (C {(export)} {(Lit_VarLike "BATS_CWD=") (DQ (CommandSubPart command_list: (CommandList children:[(C {(abs_dirname)} {(.)})]) left_token: <Left_CommandSub "$("> spids: [348 352] ) ) } ) (C {(export)} {(Lit_VarLike "PATH=") (DQ ($ VSub_Name "$BATS_LIBEXEC") (":") ($ VSub_Name "$PATH"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:options) op:Equal rhs:{(ArrayLiteralPart)} spids:[365])] spids: [365] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:arguments) op: Equal rhs: {(ArrayLiteralPart)} spids: [369] ) ] spids: [369] ) (ForEach iter_name: arg iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name arg> suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 1)}) ) spids: [392 398] ) ) } {(Lit_Other "=")} {(DQ (-))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name arg> suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 1)}) length: (ArithWord w:{(Lit_Digits 1)}) ) spids: [418 424] ) ) } {(Lit_Other "=")} {(DQ (-))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(options) (Lit_Other "[") (BracedVarSub token: <VSub_Name options> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Arith_Star) spids: [441 447] ) (Lit_Other "]") (Lit_Other "=") (DQ (BracedVarSub token: <VSub_Name arg> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [451 455] ) ) } ) ] spids: [-1 436] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:index) op: Equal rhs: {(1)} spids: [462] ) ] spids: [462] ) (While cond: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:option) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name arg> suffix_op: (Slice begin: (ArithWord w:{($ VSub_Name "$index")}) length: (ArithWord w:{(Lit_Digits 1)}) ) spids: [470 476] ) ) } spids: [468] ) ] spids: [468] ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (AndOr children: [ (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$option"))} {(Lit_Other "]")} ) (ControlFlow token: <ControlFlow_Break break> ) ] op_id: Op_DPipe ) (C {(options) (Lit_Other "[") (BracedVarSub token: <VSub_Name options> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Arith_Star) spids: [500 506] ) (Lit_Other "]") (Lit_Other "=") (DQ ($ VSub_Name "$option")) } ) (C {(let)} {(Lit_VarLike "index+=") (1)}) ] spids: [480 520] ) ) ] spids: [459 523] ) ] spids: [-1 410] ) ] else_action: [ (C {(arguments) (Lit_Other "[") (BracedVarSub token: <VSub_Name arguments> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Arith_Star) spids: [531 537] ) (Lit_Other "]") (Lit_Other "=") (DQ ($ VSub_Name "$arg")) } ) ] spids: [526 545] ) ] spids: [384 547] ) spids: [378 382] ) (C {(unset)} {(count_flag)} {(pretty)}) (AndOr children: [ (C {(Lit_Other "[")} {(-t)} {(0)} {(Lit_Other "]")}) (AndOr children: [ (C {(Lit_Other "[")} {(-t)} {(1)} {(Lit_Other "]")}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pretty) op:Equal rhs:{(DQ (1))} spids:[576])] spids: [576] ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) (AndOr children: [ (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$CI"))} {(Lit_Other "]")}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pretty) op:Equal rhs:{(DQ )} spids:[593])] spids: [593] ) ] op_id: Op_DAmp ) (ForEach iter_name: option iter_words: [ { (DQ (BracedVarSub token: <VSub_Name options> bracket_op: (WholeArray op_id:Lit_At) spids: [605 610] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Name "$option"))} arms: [ (case_arm pat_list: [{(DQ (h))} {(DQ (help))}] action: [(C {(help)}) (C {(exit)} {(0)})] spids: [627 636 647 -1] ) (case_arm pat_list: [{(DQ (v))} {(DQ (version))}] action: [(C {(version)}) (C {(exit)} {(0)})] spids: [651 660 671 -1] ) (case_arm pat_list: [{(DQ (c))} {(DQ (count))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:count_flag) op: Equal rhs: {(DQ (-c))} spids: [687] ) ] spids: [687] ) ] spids: [675 684 693 -1] ) (case_arm pat_list: [{(DQ (t))} {(DQ (tap))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pretty) op: Equal rhs: {(DQ )} spids: [709] ) ] spids: [709] ) ] spids: [697 706 714 -1] ) (case_arm pat_list: [{(DQ (p))} {(DQ (pretty))}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pretty) op: Equal rhs: {(DQ (1))} spids: [730] ) ] spids: [730] ) ] spids: [718 727 736 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (SimpleCommand words: [{(usage)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[746])] ) (C {(exit)} {(1)}) ] spids: [739 741 755 -1] ) ] spids: [617 623 758] ) ] spids: [614 760] ) spids: [603 612] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name arguments> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [768 774] ) ) } {(-eq)} {(0)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(usage)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[789])] ) (C {(exit)} {(1)}) ] spids: [-1 784] ) ] spids: [-1 797] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:filenames) op: Equal rhs: {(ArrayLiteralPart)} spids: [800] ) ] spids: [800] ) (ForEach iter_name: filename iter_words: [ { (DQ (BracedVarSub token: <VSub_Name arguments> bracket_op: (WholeArray op_id:Lit_At) spids: [811 816] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} {(DQ ($ VSub_Name "$filename"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (C {(shopt)} {(-s)} {(nullglob)}) (ForEach iter_name: suite_filename iter_words: [ { (DQ (CommandSubPart command_list: (CommandList children: [(C {(expand_path)} {(DQ ($ VSub_Name "$filename"))})] ) left_token: <Left_CommandSub "$("> spids: [853 859] ) ) (/) (Lit_Other "*") (.bats) } ] do_arg_iter: False body: (DoGroup children: [ (C {(filenames) (Lit_Other "[") (DQ (BracedVarSub token: <VSub_Name filenames> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [872 878] ) ) (Lit_Other "]") (Lit_Other "=") (DQ ($ VSub_Name "$suite_filename")) } ) ] spids: [866 887] ) spids: [851 864] ) (C {(shopt)} {(-u)} {(nullglob)}) ] spids: [-1 836] ) ] else_action: [ (C {(filenames) (Lit_Other "[") (DQ (BracedVarSub token: <VSub_Name filenames> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [903 909] ) ) (Lit_Other "]") (Lit_Other "=") (DQ (CommandSubPart command_list: (CommandList children: [(C {(expand_path)} {(DQ ($ VSub_Name "$filename"))})] ) left_token: <Left_CommandSub "$("> spids: [914 920] ) ) } ) ] spids: [897 924] ) ] spids: [820 926] ) spids: [809 818] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Name filenames> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [934 940] ) ) } {(-eq)} {(1)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:command) op: Equal rhs: {(DQ (bats-exec-test))} spids: [953] ) ] spids: [953] ) ] spids: [-1 950] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:command) op: Equal rhs: {(DQ (bats-exec-suite))} spids: [961] ) ] spids: [961] ) ] spids: [958 966] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$pretty"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:extended_syntax_flag) op: Equal rhs: {(DQ (-x))} spids: [985] ) ] spids: [985] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:formatter) op: Equal rhs: {(DQ (bats-format-tap-stream))} spids: [991] ) ] spids: [991] ) ] spids: [-1 982] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:extended_syntax_flag) op: Equal rhs: {(DQ )} spids: [999] ) ] spids: [999] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:formatter) op:Equal rhs:{(DQ (cat))} spids:[1004])] spids: [1004] ) ] spids: [996 1009] ) (C {(set)} {(-o)} {(pipefail)} {(execfail)}) (Pipeline children: [ (C {(exec)} {(DQ ($ VSub_Name "$command"))} {($ VSub_Name "$count_flag")} {($ VSub_Name "$extended_syntax_flag")} {(DQ (BracedVarSub token:<VSub_Name filenames> bracket_op:(WholeArray op_id:Lit_At) spids:[10311036]))} ) (C {(DQ ($ VSub_Name "$formatter"))}) ] negated: False ) ] )