(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stdoutF) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (tmp)} ) ) (/STDOUT) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stderrF) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (suffix_op.StringUnary op_id: VTest_ColonHyphen arg_word: {(Lit_Slash /) (tmp)} ) ) (/STDERR) ) } ) ] ) (C {(.)} {(./shflags_test_helpers)}) (command.FuncDef name: testColumns body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cols) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_columns)})]) left_token: <Left_Backtick '`'> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(expr)} {(DQ (${ VSub_Name cols))} {(Lit_Other ':')} {(SQ <'\\([0-9]*\\)'>)} ) ] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertNotNull)} {(DQ ('unexpected screen width (') (${ VSub_Name cols) (')'))} {(DQ (${ VSub_Name value))} ) ] ) ) (command.FuncDef name: testGetoptVers body: (command.BraceGroup children: [ (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(desc)} {(mock)} {(want)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(assertEquals)} {(DQ (${ VSub_Name desc))} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_getopt_vers)} {(DQ (${ VSub_Name mock))})] ) left_token: <Left_CommandSub '$('> ) ) } {(DQ (${ VSub_Name want))} ) ] ) redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 218 stdin_parts: [ ('standard mock_getopt_std ') (${ VSub_Name __FLAGS_GETOPT_VERS_STD) ('\n') ('enhanced mock_getopt_enh ') (${ VSub_Name __FLAGS_GETOPT_VERS_ENH) ('\n') ] ) ] ) ] ) ) (command.FuncDef name: mock_getopt_std body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(SQ <' -- --foo'>)}) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) terminator: <Op_Semi ';'> ) ] ) ) (command.FuncDef name: mock_getopt_enh body: (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(SQ <' --foo --'>)}) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) terminator: <Op_Semi ';'> ) ] ) ) (command.FuncDef name: testGenOptStr body: (command.BraceGroup children: [ (C {(_testGenOptStr)} {(SQ )} {(SQ )}) (C {(DEFINE_boolean)} {(bool)} {(false)} {(SQ <'boolean value'>)} {(b)}) (C {(_testGenOptStr)} {(SQ <b>)} {(SQ <bool>)}) (C {(DEFINE_float)} {(float)} {(0.0)} {(SQ <'float value'>)} {(f)}) (C {(_testGenOptStr)} {(SQ <'bf:'>)} {(SQ <'bool,float:'>)}) (C {(DEFINE_integer)} {(int)} {(0)} {(SQ <'integer value'>)} {(i)}) (C {(_testGenOptStr)} {(SQ <'bf:i:'>)} {(SQ <'bool,float:,int:'>)}) (C {(DEFINE_string)} {(str)} {(0)} {(SQ <'string value'>)} {(s)}) (C {(_testGenOptStr)} {(SQ <'bf:i:s:'>)} {(SQ <'bool,float:,int:,str:'>)}) (C {(DEFINE_boolean)} {(help)} {(false)} {(SQ <'show help'>)} {(h)}) (C {(_testGenOptStr)} {(SQ <'bf:i:s:h'>)} {(SQ <'bool,float:,int:,str:,help'>)}) ] ) ) (command.FuncDef name: _testGenOptStr body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:short) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:long) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_flags_genOptStr)} {(DQ (${ VSub_Name __FLAGS_OPTSTR_SHORT))}) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(assertTrue)} {(SQ <'short option string generation failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(DQ (${ VSub_Name short))} {(DQ (${ VSub_Name result))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_flags_genOptStr)} {(DQ (${ VSub_Name __FLAGS_OPTSTR_LONG))}) ] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'long option string generation failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(DQ (${ VSub_Name long))} {(DQ (${ VSub_Name result))}) ] ) ) (command.FuncDef name: testGetFlagInfo body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:__flags_blah_foobar) op: Equal rhs: {(SQ <1234>)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rslt) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_getFlagInfo)} {(SQ <blah>)} {(SQ <foobar>)})] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'request for valid flag info failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <'invalid flag info returned'>)} {(DQ (${ VSub_Name __flags_blah_foobar))} {(DQ (${ VSub_Name rslt))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rslt) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.SimpleCommand words: [{(_flags_getFlagInfo)} {(SQ <blah>)} {(SQ <hubbabubba>)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} ) (redir.Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} ) ] ) ] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertEquals)} {(SQ <'invalid flag did not result in an error'>)} {(DQ (${ VSub_Name FLAGS_ERROR))} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ <'missing flag info variable'>)}) ] ) ) (command.FuncDef name: testItemInList body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:list) op: Equal rhs: {(SQ <'this is a test'>)} ) ] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (C {(read)} {(desc)} {(item)} {(want)}) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(_flags_itemInList)} {(DQ (${ VSub_Name item))} {(DQ (${ VSub_Name list))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:got) op: Equal rhs: {($ VSub_QMark '$?')} ) ] ) (C {(assertEquals)} {(DQ (${ VSub_Name desc) (': itemInList(') (${ VSub_Name item) (')'))} {(DQ (${ VSub_Name got))} {(DQ (${ VSub_Name want))} ) ] ) redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 743 stdin_parts: [ ('lead_item this ') (${ VSub_Name FLAGS_TRUE) ('\n') ('middle_item is ') (${ VSub_Name FLAGS_TRUE) ('\n') ('last_item test ') (${ VSub_Name FLAGS_TRUE) ('\n') ('missing_item asdf ') (${ VSub_Name FLAGS_FALSE) ('\n') ('test_partial_te te ') (${ VSub_Name FLAGS_FALSE) ('\n') ('test_partial_es es ') (${ VSub_Name FLAGS_FALSE) ('\n') ('test_partial_st st ') (${ VSub_Name FLAGS_FALSE) ('\n') ("empty_item '' ") (${ VSub_Name FLAGS_FALSE) ('\n') ] ) ] ) (C {(_flags_itemInList)} {(SQ <item>)} {(SQ )}) (C {(assertFalse)} {(SQ <'empty lists should not match'>)} {($ VSub_QMark '$?')}) ] ) ) (command.FuncDef name: testValidBool body: (command.BraceGroup children: [ (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_BOOL_VALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validBool)} {(DQ (${ VSub_Name value))}) (C {(assertTrue)} {(DQ ('valid value (') (${ VSub_Name value) (') did not validate'))} {($ VSub_QMark '$?')} ) ] ) ) (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_BOOL_INVALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validBool)} {(DQ (${ VSub_Name value))}) (C {(assertFalse)} {(DQ ('invalid value (') (${ VSub_Name value) (') validated'))} {($ VSub_QMark '$?')} ) ] ) ) ] ) ) (command.FuncDef name: _testValidFloat body: (command.BraceGroup children: [ (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_INT_VALID)} {(${ VSub_Name TH_FLOAT_VALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validFloat)} {(DQ (${ VSub_Name value))}) (C {(assertTrue)} {(DQ ('valid value (') (${ VSub_Name value) (') did not validate'))} {($ VSub_QMark '$?')} ) ] ) ) (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_FLOAT_INVALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validFloat)} {(DQ (${ VSub_Name value))}) (C {(assertFalse)} {(DQ ('invalid value (') (${ VSub_Name value) (') validated'))} {($ VSub_QMark '$?')} ) ] ) ) ] ) ) (command.FuncDef name: testValidFloatBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testValidFloat)}) ] ) ) (command.FuncDef name: testValidFloatExpr body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.FuncDef name: _flags_useBuiltin body: (command.BraceGroup children: [ (command.Sentence child: (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(DQ (${ VSub_Name FLAGS_FALSE))} ) terminator: <Op_Semi ';'> ) ] ) ) (C {(_testValidFloat)}) ] ) ) ] ) ) (command.FuncDef name: _testValidInt body: (command.BraceGroup children: [ (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_INT_VALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validInt)} {(DQ (${ VSub_Name value))}) (C {(assertTrue)} {(DQ ('valid value (') (${ VSub_Name value) (') did not validate'))} {($ VSub_QMark '$?')} ) ] ) ) (command.ForEach iter_name: value iter_words: [{(${ VSub_Name TH_INT_INVALID)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(_flags_validInt)} {(DQ (${ VSub_Name value))}) (C {(assertFalse)} {(DQ ('invalid value (') (${ VSub_Name value) (') should not validate'))} {($ VSub_QMark '$?')} ) ] ) ) ] ) ) (command.FuncDef name: testValidIntBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testValidInt)}) ] ) ) (command.FuncDef name: testValidIntExpr body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.FuncDef name: _flags_useBuiltin body: (command.BraceGroup children: [ (command.Sentence child: (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(DQ (${ VSub_Name FLAGS_FALSE))} ) terminator: <Op_Semi ';'> ) ] ) ) (C {(_testValidInt)}) ] ) ) ] ) ) (command.FuncDef name: _testMath body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_math)} {(1)})]) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'1 failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <1>)} {(1)} {(DQ (${ VSub_Name result))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_math)} {(SQ <'1 + 2'>)})] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'1+2 failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <'1+2'>)} {(3)} {(DQ (${ VSub_Name result))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_math)} {(SQ <'1 + 2 + 3'>)})] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'1+2+3 failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <'1+2+3'>)} {(6)} {(DQ (${ VSub_Name result))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_math)})]) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertFalse)} {(SQ <'missing math succeeded'>)} {($ VSub_QMark '$?')}) ] ) ) (command.FuncDef name: testMathBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testMath)}) ] ) ) (command.FuncDef name: testMathExpr body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.FuncDef name: _flags_useBuiltin body: (command.BraceGroup children: [ (command.Sentence child: (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(DQ (${ VSub_Name FLAGS_FALSE))} ) terminator: <Op_Semi ';'> ) ] ) ) (C {(_testMath)}) ] ) ) ] ) ) (command.FuncDef name: _testStrlen body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:len) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_strlen)})]) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'missing argument failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <'missing argument'>)} {(0)} {(DQ (${ VSub_Name len))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:len) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_strlen)} {(SQ )})]) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'empty argument failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <'empty argument'>)} {(0)} {(DQ (${ VSub_Name len))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:len) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_strlen)} {(abc123)})] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'single-word failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <single-word>)} {(6)} {(DQ (${ VSub_Name len))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:len) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_strlen)} {(SQ <'This is a test'>)})] ) left_token: <Left_Backtick '`'> ) } ) ] ) (C {(assertTrue)} {(SQ <'multi-word failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <multi-word>)} {(14)} {(DQ (${ VSub_Name len))}) ] ) ) (command.FuncDef name: testStrlenBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testStrlen)}) ] ) ) (command.FuncDef name: testStrlenExpr body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.FuncDef name: _flags_useBuiltin body: (command.BraceGroup children: [ (command.Sentence child: (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(DQ (${ VSub_Name FLAGS_FALSE))} ) terminator: <Op_Semi ';'> ) ] ) ) (C {(_testStrlen)}) ] ) ) ] ) ) (command.FuncDef name: oneTimeSetUp body: (command.BraceGroup children: [ (C {(th_oneTimeSetUp)}) (command.AndOr ops: [Op_DPipe] children: [ (C {(_flags_useBuiltin)}) (C {(th_warn)} {(SQ <'Shell built-ins not supported. Some tests will be skipped.'>)}) ] ) ] ) ) (command.FuncDef name:tearDown body:(command.BraceGroup children:[(C {(flags_reset)})])) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(-n)} { (DQ (word_part.BracedVarSub token: <VSub_Name ZSH_VERSION> suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:(word.EmptyWord)) ) ) } {(Lit_Other ']')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SHUNIT_PARENT) op: Equal rhs: {($ VSub_Number '$0')} ) ] ) ] ) (C {(.)} {(DQ (${ VSub_Name TH_SHUNIT))}) ] )