(command.CommandList children: [ (C {<set>} {<-e>}) (command.ShFunction name: version body: (BraceGroup children:[(C {<echo>} {(DQ <'Bats 0.4.0'>)})]) ) (command.ShFunction name: usage body: (BraceGroup children: [ (C {<version>}) (C {<echo>} {(DQ <'Usage: bats [-c] [-p | -t] <test> [<test> ...]'>)}) ] ) ) (command.ShFunction 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>}) ] ) ) (command.ShFunction name: resolve_link body: (BraceGroup children: [ (C { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [(C {<type>} {<-p>} {<greadlink>} {<readlink>}) (C {<head>} {<-1>})] negated: F ) ) } {(DQ ($ Id.VSub_Number '$1'))} ) ] ) ) (command.ShFunction name: abs_dirname body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'cwd='> (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>}))) } ) (C {<local>} {<Id.Lit_VarLike 'path='> (DQ ($ Id.VSub_Number '$1'))}) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$path'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (C {<cd>} { (DQ (braced_var_sub token: <Id.VSub_Name path> suffix_op: (suffix_op.Unary tok: <Id.VOp1_Percent '%'> arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>} ) ) ) } ) (C {<local>} {<Id.Lit_VarLike 'name='> (DQ (braced_var_sub token: <Id.VSub_Name path> suffix_op: (suffix_op.Unary tok: <Id.VOp1_DPound '##'> arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>} ) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:path) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<resolve_link>} {(DQ ($ Id.VSub_DollarName '$name'))}) (C {<true>}) ] ) ) ) } spids: [220] ) ] ) ] ) ) (C {<pwd>}) (C {<cd>} {(DQ ($ Id.VSub_DollarName '$cwd'))}) ] ) ) (command.ShFunction name: expand_path body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (BraceGroup children: [ (command.Simple words: [ {<cd>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<dirname>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } ] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] do_fork: T ) (C {<local>} {<Id.Lit_VarLike 'dirname='> (DQ ($ Id.VSub_DollarName '$PWD'))}) (C {<cd>} {(DQ ($ Id.VSub_DollarName '$OLDPWD'))}) (C {<echo>} { (DQ ($ Id.VSub_DollarName '$dirname') <'/'> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {(DQ ($ Id.VSub_Number '$1'))}) ) ) } ) ] ) (C {<echo>} {(DQ ($ Id.VSub_Number '$1'))}) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BATS_LIBEXEC) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<abs_dirname>} {(DQ ($ Id.VSub_Number '$0'))}) ) ) } spids: [320] ) ] ) (C {<export>} {<Id.Lit_VarLike 'BATS_PREFIX='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<abs_dirname>} {(DQ ($ Id.VSub_DollarName '$BATS_LIBEXEC'))}) ) ) } ) (C {<export>} {<Id.Lit_VarLike 'BATS_CWD='> (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<abs_dirname>} {<.>}))) } ) (C {<export>} {<Id.Lit_VarLike 'PATH='> (DQ ($ Id.VSub_DollarName '$BATS_LIBEXEC') <':'> ($ Id.VSub_DollarName '$PATH')) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:options) op: assign_op.Equal rhs: {(sh_array_literal left:<Id.Op_LParen _>)} spids: [365] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:arguments) op: assign_op.Equal rhs: {(sh_array_literal left:<Id.Op_LParen _>)} spids: [369] ) ] ) (command.ForEach iter_name: arg iter_words: [{(DQ ($ Id.VSub_At '$@'))}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name arg> suffix_op: (suffix_op.Slice begin: {<Id.Lit_Digits 0>} length: {<Id.Lit_Digits 1>} ) ) ) } {<Id.Lit_Equals '='>} {(DQ <->)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name arg> suffix_op: (suffix_op.Slice begin: {<Id.Lit_Digits 1>} length: {<Id.Lit_Digits 1>} ) ) ) } {<Id.Lit_Equals '='>} {(DQ <->)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: options index: { (braced_var_sub token: <Id.VSub_Name options> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name arg> suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 2>}) ) ) } spids: [439] ) ] ) ] spids: [413 436] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:index) op: assign_op.Equal rhs: {<1>} spids: [468] ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:option) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name arg> suffix_op: (suffix_op.Slice begin: {($ Id.VSub_DollarName '$index')} length: {<Id.Lit_Digits 1>} ) ) ) } spids: [474] ) ] ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$option'))} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token: <Id.ControlFlow_Break break> ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: options index: { (braced_var_sub token: <Id.VSub_Name options> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id: Id.Arith_Star ) ) } ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$option'))} spids: [504] ) ] ) (C {<let>} {<Id.Lit_VarLike 'index+='> <1>}) ] ) ) ] ) ] spids: [387 410] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: arguments index: { (braced_var_sub token: <Id.VSub_Name arguments> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) ) } ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$arg'))} spids: [541] ) ] ) ] ) ] ) ) (C {<unset>} {<count_flag>} {<pretty>}) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-t>} {<0>} {<Id.Lit_RBracket ']'>}) (C {<Id.Lit_LBracket '['>} {<-t>} {<1>} {<Id.Lit_RBracket ']'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pretty) op: assign_op.Equal rhs: {(DQ <1>)} spids: [594] ) ] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$CI'))} {<Id.Lit_RBracket ']'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pretty) op: assign_op.Equal rhs: {(DQ )} spids: [611] ) ] ) ] ) (command.ForEach iter_name: option iter_words: [ { (DQ (braced_var_sub token: <Id.VSub_Name options> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$option'))} arms: [ (case_arm pat_list: [{(DQ <h>)} {(DQ <help>)}] action: [ (C {<help>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [644 654 665 -1] ) (case_arm pat_list: [{(DQ <v>)} {(DQ <version>)}] action: [ (C {<version>}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [668 678 689 -1] ) (case_arm pat_list: [{(DQ <c>)} {(DQ <count>)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count_flag) op: assign_op.Equal rhs: {(DQ <-c>)} spids: [705] ) ] ) ] spids: [692 702 711 -1] ) (case_arm pat_list: [{(DQ <t>)} {(DQ <tap>)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pretty) op: assign_op.Equal rhs: {(DQ )} spids: [727] ) ] ) ] spids: [714 724 732 -1] ) (case_arm pat_list: [{(DQ <p>)} {(DQ <pretty>)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:pretty) op: assign_op.Equal rhs: {(DQ <1>)} spids: [748] ) ] ) ] spids: [735 745 754 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.Simple words: [{<usage>}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [757 759 773 -1] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name arguments> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [{<usage>}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [781 802] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filenames) op: assign_op.Equal rhs: {(sh_array_literal left:<Id.Op_LParen _>)} spids: [818] ) ] ) (command.ForEach iter_name: filename iter_words: [ { (DQ (braced_var_sub token: <Id.VSub_Name arguments> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ ($ Id.VSub_DollarName '$filename'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<shopt>} {<-s>} {<nullglob>}) (command.ForEach iter_name: suite_filename iter_words: [ { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<expand_path>} {(DQ ($ Id.VSub_DollarName '$filename'))}) ) ) <'/'> <Id.Lit_Star '*'> <.bats> } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: filenames index: { (DQ (braced_var_sub token: <Id.VSub_Name filenames> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$suite_filename'))} spids: [887] ) ] ) ] ) ) (C {<shopt>} {<-u>} {<nullglob>}) ] spids: [841 854] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: filenames index: { (DQ (braced_var_sub token: <Id.VSub_Name filenames> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<expand_path>} {(DQ ($ Id.VSub_DollarName '$filename'))}) ) ) } spids: [926] ) ] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name filenames> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } {<-eq>} {<1>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ <bats-exec-test>)} spids: [987] ) ] ) ] spids: [963 984] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ <bats-exec-suite>)} spids: [995] ) ] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ ($ Id.VSub_DollarName '$pretty'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:extended_syntax_flag) op: assign_op.Equal rhs: {(DQ <-x>)} spids: [1019] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:formatter) op: assign_op.Equal rhs: {(DQ <bats-format-tap-stream>)} spids: [1025] ) ] ) ] spids: [1003 1016] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:extended_syntax_flag) op: assign_op.Equal rhs: {(DQ )} spids: [1033] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:formatter) op: assign_op.Equal rhs: {(DQ <cat>)} spids: [1038] ) ] ) ] ) (C {<set>} {<-o>} {<pipefail>} {<execfail>}) (command.Pipeline children: [ (C {<exec>} {(DQ ($ Id.VSub_DollarName '$command'))} {($ Id.VSub_DollarName '$count_flag')} {($ Id.VSub_DollarName '$extended_syntax_flag')} { (DQ (braced_var_sub token: <Id.VSub_Name filenames> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) (C {(DQ ($ Id.VSub_DollarName '$formatter'))}) ] negated: F ) ] )