(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stdoutF) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(Lit_Slash /) (tmp)}) spids: [48 53] ) (/STDOUT) ) } spids: [46] ) ] spids: [46] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stderrF) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(Lit_Slash /) (tmp)}) spids: [59 64] ) (/STDERR) ) } spids: [57] ) ] spids: [57] ) (C {(.)} {(./shflags_test_helpers)}) (FuncDef name: testFlagsDefine body: (BraceGroup children: [ (SimpleCommand words: [{(_flags_define)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [90] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [97] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() with no arguments should have failed.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ )} {(SQ <'no arguments'>)}) (SimpleCommand words: [{(_flags_define)} {(arg1)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [133] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [140] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() call with one argument should fail'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ )} {(SQ <'one argument'>)}) (SimpleCommand words: [{(_flags_define)} {(arg1)} {(arg2)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [178] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [185] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() call with two arguments should fail'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ )} {(SQ <'two arguments'>)}) (SimpleCommand words: [{(_flags_define)} {(arg1)} {(arg2)} {(arg3)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [225] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [232] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() call with three arguments should fail'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ )} {(SQ <'three arguments'>)}) (C {(_flags_define)} {(DQ (${ VSub_Name __FLAGS_TYPE_BOOLEAN))} {(multiDefBool)} {(true)} {(SQ <'multi def #1'>)} {(m)} ) (SimpleCommand words: [ {(_flags_define)} {(DQ (${ VSub_Name __FLAGS_TYPE_BOOLEAN))} {(multiDefBool)} {(false)} {(SQ <'multi def #2'>)} {(m)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [303] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [310] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() with existing flag name should fail'>)} {($ VSub_QMark '$?')} ) (C {(assertTrue)} {(SQ <'_flags_define() should not overwrite previously defined default.'>)} { (DQ (BracedVarSub token: <VSub_Name FLAGS_multiDefBool> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [338 341] ) ) } ) (C {(assertWarnMsg)} {(SQ )} {(SQ <'existing flag'>)}) (C {(_flags_define)} {(DQ (${ VSub_Name __FLAGS_TYPE_STRING))} {(long-name)} {(SQ <foo>)} {(SQ <'dashed name'>)} {(l)} ) (SimpleCommand words: [ {(_flags_define)} {(DQ (${ VSub_Name __FLAGS_TYPE_STRING))} {(long_name)} {(SQ <bar>)} {(SQ <'underscored name'>)} {(l)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [403] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [410] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() with existing flag name should fail'>)} {($ VSub_QMark '$?')} ) (C {(assertEquals)} {(SQ <'_flags_define() should not overwrite previously defined default.'>)} {(DQ (${ VSub_Name FLAGS_long_name))} {(SQ <foo>)} ) (C {(assertWarnMsg)} {(SQ )} {(SQ <'already exists'>)}) (SimpleCommand words: [{(_flags_define)} {(invalid)} {(arg2)} {(arg3)} {(arg4)} {(i)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [484] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [491] ) ] ) (C {(assertFalse)} {(SQ <'_flags_define() with "invalid" type should have failed.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ <'unrecognized flag type'>)} {(SQ <'invalid type'>)}) ] spids: [81] ) spids: [77 80] ) (FuncDef name: testBoolean body: (BraceGroup children: [ (ForEach iter_name: default iter_words: [{(SQ <true>)} {(SQ <t>)} {(0)}] do_arg_iter: F body: (DoGroup children: [ (C {(flags_reset)}) (C {(DEFINE_boolean)} {(boolVal)} {(DQ (${ VSub_Name default))} {(SQ <'my boolean'>)} {(b)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [572] ) ] spids: [572] ) (C {(assertTrue)} { (DQ ("DEFINE_boolean() call with default of '") (${ VSub_Name default) ("' failed.") ) } { (DQ (BracedVarSub token: <VSub_Name FLAGS_boolVal> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [591 594] ) ) } ) (C {(assertTrue)} { (DQ ("DEFINE_boolean() call with default of '") (${ VSub_Name default) ("' returned failure.") ) } {(${ VSub_Name rtrn)} ) ] spids: [549 617] ) spids: [537 547] ) (ForEach iter_name: default iter_words: [{(SQ <false>)} {(SQ <f>)} {(1)}] do_arg_iter: F body: (DoGroup children: [ (C {(flags_reset)}) (C {(DEFINE_boolean)} {(boolVal)} {(DQ (${ VSub_Name default))} {(SQ <'my boolean'>)} {(b)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [665] ) ] spids: [665] ) (C {(assertFalse)} { (DQ ("DEFINE_boolean() call with default of '") (${ VSub_Name default) ("' failed.") ) } { (DQ (BracedVarSub token: <VSub_Name FLAGS_boolVal> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [684 687] ) ) } ) (C {(assertTrue)} { (DQ ("DEFINE_boolean() call with default of '") (${ VSub_Name default) ("' returned failure.") ) } {(${ VSub_Name rtrn)} ) ] spids: [642 710] ) spids: [630 640] ) (C {(flags_reset)}) (SimpleCommand words: [{(DEFINE_boolean)} {(boolVal)} {(SQ <invalid>)} {(SQ <'my boolean'>)} {(b)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [735] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [742] ) ] ) (C {(assertFalse)} {(SQ <'DEFINE_boolean() call with invalid default did not fail.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)}) ] spids: [525] ) spids: [521 524] ) (FuncDef name: testFloat body: (BraceGroup children: [ (ForEach iter_name: default iter_words: [{(${ VSub_Name TH_FLOAT_VALID)}] do_arg_iter: F body: (DoGroup children: [ (C {(flags_reset)}) (C {(DEFINE_float)} {(floatVal)} {(DQ (${ VSub_Name default))} {(DQ ('float: ') (${ VSub_Name default))} {(f)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [812] ) ] spids: [812] ) (C {(assertSame)} {(DQ ('DEFINE_float() call with valid default failed.'))} {(DQ (${ VSub_Name default))} { (DQ (BracedVarSub token: <VSub_Name FLAGS_floatVal> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [831 834] ) ) } ) (C {(assertTrue)} { (DQ ("DEFINE_float() call with valid default of '") (${ VSub_Name default) ("' returned failure.") ) } {(${ VSub_Name rtrn)} ) ] spids: [786 857] ) spids: [780 784] ) (C {(flags_reset)}) (SimpleCommand words: [ {(DEFINE_float)} {(floatVal)} {(SQ <invalid>)} {(SQ <'invalid float: string'>)} {(f)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [884] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [891] ) ] ) (C {(assertFalse)} {(SQ <'DEFINE_float() call with string value default did not fail.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)}) ] spids: [768] ) spids: [764 767] ) (FuncDef name: testInteger body: (BraceGroup children: [ (ForEach iter_name: default iter_words: [{(${ VSub_Name TH_INT_VALID)}] do_arg_iter: F body: (DoGroup children: [ (C {(flags_reset)}) (C {(DEFINE_integer)} {(intVal)} {(DQ (${ VSub_Name default))} {(DQ ('integer: ') (${ VSub_Name default))} {(i)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [961] ) ] spids: [961] ) (C {(assertSame)} {(DQ ('DEFINE_integer() call with valid default failed.'))} {(DQ (${ VSub_Name default))} { (DQ (BracedVarSub token: <VSub_Name FLAGS_intVal> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [982 985] ) ) } ) (C {(assertTrue)} { (DQ ("DEFINE_integer() call with valid default of '") (${ VSub_Name default) ("' returned failure.") ) } {(${ VSub_Name rtrn)} ) ] spids: [935 1008] ) spids: [929 933] ) (C {(flags_reset)}) (SimpleCommand words: [{(DEFINE_integer)} {(intVal)} {(1.234)} {(SQ <'invalid integer: float'>)} {(i)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [1033] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [1040] ) ] ) (C {(assertFalse)} {(SQ <'DEFINE_integer() call with float value default did not fail.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ <'invalid default'>)} {(SQ <'float default'>)}) (SimpleCommand words: [ {(DEFINE_integer)} {(intVal)} {(-1.234)} {(SQ <'invalid integer: negative float'>)} {(i)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [1083] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [1090] ) ] ) (C {(assertFalse)} {(SQ <'DEFINE_integer() call with negative float value default did not fail.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ <'invalid default'>)} {(SQ <'negative float default'>)}) (SimpleCommand words: [ {(DEFINE_integer)} {(intVal)} {(SQ <invalid>)} {(SQ <'invalid integer: string'>)} {(i)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [1139] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [1146] ) ] ) (C {(assertFalse)} {(SQ <'DEFINE_integer() call with string value default did not fail.'>)} {($ VSub_QMark '$?')} ) (C {(assertErrorMsg)} {(SQ <'invalid default'>)} {(SQ <'string default'>)}) ] spids: [917] ) spids: [913 916] ) (FuncDef name: testString body: (BraceGroup children: [ (ForEach iter_name: default iter_words: [ {(${ VSub_Name TH_BOOL_VALID)} {(${ VSub_Name TH_FLOAT_VALID)} {(${ VSub_Name TH_INT_VALID)} {(SQ <'also valid'>)} ] do_arg_iter: F body: (DoGroup children: [ (C {(flags_reset)}) (C {(DEFINE_string)} {(strVal)} {(DQ (${ VSub_Name default))} {(DQ ('string: ') (${ VSub_Name default))} {(s)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [1248] ) ] spids: [1248] ) (C {(assertSame)} {(DQ ('DEFINE_string() call with valid default failed.'))} {(DQ (${ VSub_Name default))} { (DQ (BracedVarSub token: <VSub_Name FLAGS_strVal> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [1269 1272] ) ) } ) (C {(assertTrue)} { (DQ ("DEFINE_string() call with valid default of '") (${ VSub_Name default) ("' returned failure.") ) } {(${ VSub_Name rtrn)} ) ] spids: [1222 1295] ) spids: [1196 16777215] ) (C {(flags_reset)}) (C {(DEFINE_string)} {(str)} {(SQ )} {(DQ ('string: empty single quotes'))} {(s)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [1320] ) ] spids: [1320] ) (C {(assertSame)} {(DQ ('DEFINE_string() call with valid default failed.'))} {(SQ )} { (DQ (BracedVarSub token: <VSub_Name FLAGS_str> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [1338 1341] ) ) } ) ] spids: [1184] ) spids: [1180 1183] ) (FuncDef name: testShortNameLength body: (BraceGroup children:[(C {(Lit_Other ':')})] spids:[1351]) spids: [1347 1350] ) (FuncDef name: testFlagNameIsReserved body: (BraceGroup children: [ (Subshell child: (SimpleCommand words: [{(DEFINE_string)} {(TRUE)} {(SQ )} {(SQ <'true is a reserved flag name'>)} {(t)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name stdoutF))} spids: [1387] ) (Redir op_id: Redir_Great fd: 2 arg_word: {(DQ (${ VSub_Name stderrF))} spids: [1394] ) ] ) spids: [1370 1401] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:rtrn) op: Equal rhs: {($ VSub_QMark '$?')} spids: [1404] ) ] spids: [1404] ) (C {(assertEquals)} {(DQ (${ VSub_Name FLAGS_ERROR))} {(DQ (${ VSub_Name rtrn))}) (C {(assertErrorMsg)} {(SQ <'flag name (TRUE) is reserved'>)}) ] spids: [1367] ) spids: [1363 1366] ) (FuncDef name: oneTimeSetUp body: (BraceGroup children:[(C {(th_oneTimeSetUp)})] spids:[1436]) spids: [1432 1435] ) (FuncDef name: tearDown body: (BraceGroup children:[(C {(flags_reset)})] spids:[1448]) spids: [1444 1447] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(-n)} { (DQ (BracedVarSub token: <VSub_Name ZSH_VERSION> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(EmptyPart)}) spids: [1467 1470] ) ) } {(Lit_Other ']')} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SHUNIT_PARENT) op: Equal rhs: {($ VSub_Number '$0')} spids: [1477] ) ] spids: [1477] ) ] ) (C {(.)} {(DQ (${ VSub_Name TH_SHUNIT))}) ] )