(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stdoutF spids:[61]) 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)} ) spids: [63 68] ) (/STDOUT) ) } spids: [61] ) ] spids: [61] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stderrF spids:[72]) 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)} ) spids: [74 79] ) (/STDERR) ) } spids: [72] ) ] spids: [72] ) (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 spids:[99]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_columns)})]) left_token: <Left_Backtick '`'> spids: [100 102] ) } spids: [99] ) ] spids: [99] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value spids:[105]) 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 '`'> spids: [106 120] ) } spids: [105] ) ] spids: [105] ) (C {(assertNotNull)} {(DQ ('unexpected screen width (') (${ VSub_Name cols) (')'))} {(DQ (${ VSub_Name value))} ) ] spids: [96] ) spids: [92 95] ) (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 '$('> spids: [176 184] ) ) } {(DQ (${ VSub_Name want))} ) ] spids: [164 194] ) redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 210 stdin_parts: [ ('standard mock_getopt_std ') (${ VSub_Name __FLAGS_GETOPT_VERS_STD) ('\n') ('enhanced mock_getopt_enh ') (${ VSub_Name __FLAGS_GETOPT_VERS_ENH) ('\n') ] ) ] ) ] spids: [146] ) spids: [142 145] ) (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 ';'> ) ] spids: [224] ) spids: [220 223] ) (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 ';'> ) ] spids: [247] ) spids: [243 246] ) (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'>)}) ] spids: [268] ) spids: [264 267] ) (command.FuncDef name: _testGenOptStr body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:short spids:[414]) op: Equal rhs: {($ VSub_Number '$1')} spids: [414] ) ] spids: [414] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:long spids:[418]) op: Equal rhs: {($ VSub_Number '$2')} spids: [418] ) ] spids: [418] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[423]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_flags_genOptStr)} {(DQ (${ VSub_Name __FLAGS_OPTSTR_SHORT))}) ] ) left_token: <Left_CommandSub '$('> spids: [424 432] ) } spids: [423] ) ] spids: [423] ) (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 spids:[460]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_flags_genOptStr)} {(DQ (${ VSub_Name __FLAGS_OPTSTR_LONG))}) ] ) left_token: <Left_Backtick '`'> spids: [461 469] ) } spids: [460] ) ] spids: [460] ) (C {(assertTrue)} {(SQ <'long option string generation failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(DQ (${ VSub_Name long))} {(DQ (${ VSub_Name result))}) ] spids: [411] ) spids: [407 410] ) (command.FuncDef name: testGetFlagInfo body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:__flags_blah_foobar spids:[505]) op: Equal rhs: {(SQ <1234>)} spids: [505] ) ] spids: [505] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:rslt spids:[512]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_getFlagInfo)} {(SQ <blah>)} {(SQ <foobar>)})] ) left_token: <Left_Backtick '`'> spids: [513 523] ) } spids: [512] ) ] spids: [512] ) (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 spids:[555]) 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 '`'> spids: [556 580] ) } spids: [555] ) ] spids: [555] ) (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'>)}) ] spids: [502] ) spids: [498 501] ) (command.FuncDef name: testItemInList body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:list spids:[614]) op: Equal rhs: {(SQ <'this is a test'>)} spids: [614] ) ] spids: [614] ) (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 spids:[653]) op: Equal rhs: {($ VSub_QMark '$?')} spids: [653] ) ] spids: [653] ) (C {(assertEquals)} {(DQ (${ VSub_Name desc) (': itemInList(') (${ VSub_Name item) (')'))} {(DQ (${ VSub_Name got))} {(DQ (${ VSub_Name want))} ) ] spids: [635 683] ) redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 729 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 '$?')}) ] spids: [611] ) spids: [607 610] ) (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 '$?')} ) ] spids: [775 800] ) spids: [769 773] ) (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 '$?')} ) ] spids: [819 844] ) spids: [813 817] ) ] spids: [757] ) spids: [753 756] ) (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 '$?')} ) ] spids: [875 900] ) spids: [865 873] ) (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 '$?')} ) ] spids: [919 944] ) spids: [913 917] ) ] spids: [853] ) spids: [849 852] ) (command.FuncDef name: testValidFloatBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testValidFloat)}) ] spids: [953] ) spids: [949 952] ) (command.FuncDef name: testValidFloatExpr body: (command.BraceGroup children: [ (command.Subshell child: (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 ';'> ) ] spids: [982] ) spids: [978 981] ) (C {(_testValidFloat)}) ] ) spids: [975 999] ) ] spids: [972] ) spids: [968 971] ) (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 '$?')} ) ] spids: [1026 1051] ) spids: [1020 1024] ) (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 '$?')} ) ] spids: [1070 1095] ) spids: [1064 1068] ) ] spids: [1008] ) spids: [1004 1007] ) (command.FuncDef name: testValidIntBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testValidInt)}) ] spids: [1104] ) spids: [1100 1103] ) (command.FuncDef name: testValidIntExpr body: (command.BraceGroup children: [ (command.Subshell child: (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 ';'> ) ] spids: [1133] ) spids: [1129 1132] ) (C {(_testValidInt)}) ] ) spids: [1126 1150] ) ] spids: [1123] ) spids: [1119 1122] ) (command.FuncDef name: _testMath body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:result spids:[1162]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_math)} {(1)})]) left_token: <Left_Backtick '`'> spids: [1163 1167] ) } spids: [1162] ) ] spids: [1162] ) (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 spids:[1195]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_math)} {(SQ <'1 + 2'>)})] ) left_token: <Left_Backtick '`'> spids: [1196 1202] ) } spids: [1195] ) ] spids: [1195] ) (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 spids:[1230]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_math)} {(SQ <'1 + 2 + 3'>)})] ) left_token: <Left_Backtick '`'> spids: [1231 1237] ) } spids: [1230] ) ] spids: [1230] ) (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 spids:[1265]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_math)})]) left_token: <Left_Backtick '`'> spids: [1266 1268] ) } spids: [1265] ) ] spids: [1265] ) (C {(assertFalse)} {(SQ <'missing math succeeded'>)} {($ VSub_QMark '$?')}) ] spids: [1159] ) spids: [1155 1158] ) (command.FuncDef name: testMathBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testMath)}) ] spids: [1286] ) spids: [1282 1285] ) (command.FuncDef name: testMathExpr body: (command.BraceGroup children: [ (command.Subshell child: (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 ';'> ) ] spids: [1315] ) spids: [1311 1314] ) (C {(_testMath)}) ] ) spids: [1308 1332] ) ] spids: [1305] ) spids: [1301 1304] ) (command.FuncDef name: _testStrlen body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:len spids:[1344]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_strlen)})]) left_token: <Left_Backtick '`'> spids: [1345 1347] ) } spids: [1344] ) ] spids: [1344] ) (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 spids:[1375]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(_flags_strlen)} {(SQ )})]) left_token: <Left_Backtick '`'> spids: [1376 1381] ) } spids: [1375] ) ] spids: [1375] ) (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 spids:[1409]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_strlen)} {(abc123)})] ) left_token: <Left_Backtick '`'> spids: [1410 1414] ) } spids: [1409] ) ] spids: [1409] ) (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 spids:[1442]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(_flags_strlen)} {(SQ <'This is a test'>)})] ) left_token: <Left_Backtick '`'> spids: [1443 1449] ) } spids: [1442] ) ] spids: [1442] ) (C {(assertTrue)} {(SQ <'multi-word failed'>)} {($ VSub_QMark '$?')}) (C {(assertEquals)} {(SQ <multi-word>)} {(14)} {(DQ (${ VSub_Name len))}) ] spids: [1341] ) spids: [1337 1340] ) (command.FuncDef name: testStrlenBuiltin body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DPipe] children: [(C {(_flags_useBuiltin)}) (C {(startSkipping)})] ) (C {(_testStrlen)}) ] spids: [1482] ) spids: [1478 1481] ) (command.FuncDef name: testStrlenExpr body: (command.BraceGroup children: [ (command.Subshell child: (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 ';'> ) ] spids: [1511] ) spids: [1507 1510] ) (C {(_testStrlen)}) ] ) spids: [1504 1528] ) ] spids: [1501] ) spids: [1497 1500] ) (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.'>)}) ] ) ] spids: [1537] ) spids: [1533 1536] ) (command.FuncDef name: tearDown body: (command.BraceGroup children:[(C {(flags_reset)})] spids:[1563]) spids: [1559 1562] ) (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)) spids: [1582 1585] ) ) } {(Lit_Other ']')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:SHUNIT_PARENT spids:[1592]) op: Equal rhs: {($ VSub_Number '$0')} spids: [1592] ) ] spids: [1592] ) ] ) (C {(.)} {(DQ (${ VSub_Name TH_SHUNIT))}) ] )