(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description spids:[13]) op: Equal rhs: { (SQ <'Test the very basics part #1.\n'> <'\n'> <'The rest of the test suite does not check the basic operation of git\n'> <'plumbing commands to work very carefully. Their job is to concentrate\n'> <'on tricky features that caused bugs in the past to detect regression.\n'> <'\n'> <'This test runs very basic features, like registering things in cache,\n'> <'writing tree, etc.\n'> <'\n'> <'Note that this test *deliberately* hard-codes many expected object\n'> <'IDs. When object ID computation changes, like in the previous case of\n'> <'swapping compression and hashing order, the person who is making the\n'> <'modification *should* take notice and update the test vectors here.\n'> ) } spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <'.git/objects should be empty after git init in an empty repo'>)} { (SQ <'\n'> <'\tfind .git/objects -type f -print >should-be-empty &&\n'> <'\ttest_line_count = 0 should-be-empty\n'> ) } ) (C {(test_expect_success)} {(SQ <'.git/objects should have 3 subdirectories'>)} { (SQ <'\n'> <'\tfind .git/objects -type d -print >full-of-directories &&\n'> <'\ttest_line_count = 3 full-of-directories\n'> ) } ) (C {(test_expect_success)} {(SQ <'success is reported like this'>)} {(SQ <'\n'> <'\t:\n'>)}) (FuncDef name: _run_sub_test_lib_test_common body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:neg spids:[104]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [104] ) (assign_pair lhs: (LhsName name:name spids:[109]) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [109] ) (assign_pair lhs: (LhsName name:descr spids:[114]) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} spids: [114] ) ] spids: [104] ) (C {(shift)} {(3)}) (AndOr ops: [Op_DAmp] children: [ (C {(mkdir)} {(DQ ($ VSub_Name '$name'))}) (Subshell child: (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(sane_unset)} {(HARNESS_ACTIVE)}) (C {(cd)} {(DQ ($ VSub_Name '$name'))}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$name') (.sh))} ) (HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 205 stdin_parts: [ ('#!') ($ VSub_Name '$SHELL_PATH') ('\n') ('\n') ("test_description='") ($ VSub_Name '$descr') (' (run in sub test-lib)\n') ('\n') ('This is run in a sub test-lib so that we do not get incorrect\n') ('passing metrics\n') ("'\n") ('\n') ("# Point to the t/test-lib.sh, which isn't in ../ as usual\n") ('. ') (Right_DoubleQuote '"') (EscapedLiteralPart token: <Lit_EscapedChar '\\$'> ) (TEST_DIRECTORY) (Right_DoubleQuote '"') ('/test-lib.sh\n') ] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(DQ ($ VSub_Name '$name') (.sh))} ) ] ) (C {(chmod)} {(Lit_Other '+') (x)} {(DQ ($ VSub_Name '$name') (.sh))}) (C {(export)} {(TEST_DIRECTORY)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TEST_OUTPUT_DIRECTORY spids:[238]) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(pwd)})]) left_token: <Left_CommandSub '$('> spids: [239 241] ) } spids: [238] ) ] spids: [238] ) (C {(export)} {(TEST_OUTPUT_DIRECTORY)}) (If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_Name '$neg'))})] action: [ (SimpleCommand words: [ {(./) (DQ ($ VSub_Name '$name') (.sh))} {(DQ ($ VSub_At '$@'))} ] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(out)} ) (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(err)} ) ] ) ] spids: [16777215 264] ) ] else_action: [ (Pipeline children: [ (SimpleCommand words: [ {(./) (DQ ($ VSub_Name '$name') (.sh))} {(DQ ($ VSub_At '$@'))} ] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(out)} ) (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(err)} ) ] ) ] negated: T ) ] spids: [284 306] ) ] ) spids: [137 309] ) ] ) ] spids: [101] ) spids: [96 100] ) (FuncDef name: run_sub_test_lib_test body: (BraceGroup children: [(C {(_run_sub_test_lib_test_common)} {(SQ )} {(DQ ($ VSub_At '$@'))})] spids: [319] ) spids: [314 318] ) (FuncDef name: run_sub_test_lib_test_err body: (BraceGroup children: [(C {(_run_sub_test_lib_test_common)} {(SQ <'!'>)} {(DQ ($ VSub_At '$@'))})] spids: [339] ) spids: [334 338] ) (FuncDef name: check_sub_test_lib_test body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name spids:[363]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [363] ) ] spids: [363] ) (Subshell child: (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_Name '$name'))}) (Pipeline children:[(C {(test)} {(-s)} {(err)})] negated:T) (SimpleCommand words: [{(sed)} {(-e)} {(SQ <'s/^> //'>)} {(-e)} {(SQ <'s/Z$//'>)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})] ) (C {(test_cmp)} {(expect)} {(out)}) ] ) spids: [372 422] ) ] spids: [360] ) spids: [355 359] ) (FuncDef name: check_sub_test_lib_test_err body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name spids:[435]) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [435] ) ] spids: [435] ) (Subshell child: (AndOr ops: [Op_DAmp Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_Name '$name'))}) (SimpleCommand words: [{(sed)} {(-e)} {(SQ <'s/^> //'>)} {(-e)} {(SQ <'s/Z$//'>)}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect.out)})] ) (C {(test_cmp)} {(expect.out)} {(out)}) (SimpleCommand words: [{(sed)} {(-e)} {(SQ <'s/^> //'>)} {(-e)} {(SQ <'s/Z$//'>)}] redirects: [ (Redir op: <Redir_LessAnd '<&'> fd: 16777215 arg_word: {(3)} ) (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expect.err)} ) ] ) (C {(test_cmp)} {(expect.err)} {(err)}) ] ) spids: [448 519] ) ] spids: [432] ) spids: [427 431] ) (C {(test_expect_success)} {(SQ <'pretend we have a fully passing test suite'>)} { (DQ ('\n') ("\trun_sub_test_lib_test full-pass '3 passing tests' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test full-pass <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 - passing test #3\n') ('\t> # passed all 3 test(s)\n') ('\t> 1..3\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have a partially passing test suite'>)} { (DQ ('\n') ('\ttest_must_fail run_sub_test_lib_test ') ("\t\tpartial-pass '2/3 tests passing' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_success 'passing test #1' 'true'\n") ("\ttest_expect_success 'failing test #2' 'false'\n") ("\ttest_expect_success 'passing test #3' 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test partial-pass <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> not ok 2 - failing test #2\n') ('\t#\tfalse\n') ('\t> ok 3 - passing test #3\n') ('\t> # failed 1 among 3 test(s)\n') ('\t> 1..3\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have a known breakage'>)} { (DQ ('\n') ("\trun_sub_test_lib_test failing-todo 'A failing TODO test' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_failure 'pretend we have a known breakage' 'false'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test failing-todo <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test\n') ('\t> not ok 2 - pretend we have a known breakage # TODO known breakage\n') ('\t> # still have 1 known breakage(s)\n') ('\t> # passed all remaining 1 test(s)\n') ('\t> 1..2\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have fixed a known breakage'>)} { (DQ ('\n') ("\trun_sub_test_lib_test passing-todo 'A passing TODO test' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_failure 'pretend we have fixed a known breakage' 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test passing-todo <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - pretend we have fixed a known breakage # TODO known breakage vanished\n') ('\t> # 1 known breakage(s) vanished; please update test(s)\n') ('\t> 1..1\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have fixed one of two known breakages (run in sub test-lib)'>)} { (DQ ('\n') ('\trun_sub_test_lib_test partially-passing-todos ') ("\t\t'2 TODO tests, one passing' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_failure 'pretend we have a known breakage' 'false'\n") ("\ttest_expect_success 'pretend we have a passing test' 'true'\n") ("\ttest_expect_failure 'pretend we have fixed another known breakage' 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test partially-passing-todos <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> not ok 1 - pretend we have a known breakage # TODO known breakage\n') ('\t> ok 2 - pretend we have a passing test\n') ('\t> ok 3 - pretend we have fixed another known breakage # TODO known breakage vanished\n') ('\t> # 1 known breakage(s) vanished; please update test(s)\n') ('\t> # still have 1 known breakage(s)\n') ('\t> # passed all remaining 1 test(s)\n') ('\t> 1..3\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have a pass, fail, and known breakage'>)} { (DQ ('\n') ('\ttest_must_fail run_sub_test_lib_test ') ("\t\tmixed-results1 'mixed results #1' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_success 'failing test' 'false'\n") ("\ttest_expect_failure 'pretend we have a known breakage' 'false'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test mixed-results1 <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test\n') ('\t> not ok 2 - failing test\n') ('\t> #\tfalse\n') ('\t> not ok 3 - pretend we have a known breakage # TODO known breakage\n') ('\t> # still have 1 known breakage(s)\n') ('\t> # failed 1 among remaining 2 test(s)\n') ('\t> 1..3\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'pretend we have a mix of all possible results'>)} { (DQ ('\n') ('\ttest_must_fail run_sub_test_lib_test ') ("\t\tmixed-results2 'mixed results #2' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_success 'passing test' 'true'\n") ("\ttest_expect_success 'failing test' 'false'\n") ("\ttest_expect_success 'failing test' 'false'\n") ("\ttest_expect_success 'failing test' 'false'\n") ("\ttest_expect_failure 'pretend we have a known breakage' 'false'\n") ("\ttest_expect_failure 'pretend we have a known breakage' 'false'\n") ("\ttest_expect_failure 'pretend we have fixed a known breakage' 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test mixed-results2 <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test\n') ('\t> ok 2 - passing test\n') ('\t> ok 3 - passing test\n') ('\t> ok 4 - passing test\n') ('\t> not ok 5 - failing test\n') ('\t> #\tfalse\n') ('\t> not ok 6 - failing test\n') ('\t> #\tfalse\n') ('\t> not ok 7 - failing test\n') ('\t> #\tfalse\n') ('\t> not ok 8 - pretend we have a known breakage # TODO known breakage\n') ('\t> not ok 9 - pretend we have a known breakage # TODO known breakage\n') ('\t> ok 10 - pretend we have fixed a known breakage # TODO known breakage vanished\n') ('\t> # 1 known breakage(s) vanished; please update test(s)\n') ('\t> # still have 2 known breakage(s)\n') ('\t> # failed 3 among remaining 7 test(s)\n') ('\t> 1..10\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'test --verbose'>)} { (SQ <'\n'> <'\ttest_must_fail run_sub_test_lib_test \\\n'> <'\t\ttest-verbose "test verbose" --verbose <<-\\EOF &&\n'> <'\ttest_expect_success "passing test" true\n'> <'\ttest_expect_success "test with output" "echo foo"\n'> <'\ttest_expect_success "failing test" false\n'> <'\ttest_done\n'> <'\tEOF\n'> <'\tmv test-verbose/out test-verbose/out+ &&\n'> <'\tgrep -v "^Initialized empty" test-verbose/out+ >test-verbose/out &&\n'> <'\tcheck_sub_test_lib_test test-verbose <<-\\EOF\n'> <'\t> expecting success: true\n'> <'\t> ok 1 - passing test\n'> <'\t> Z\n'> <'\t> expecting success: echo foo\n'> <'\t> foo\n'> <'\t> ok 2 - test with output\n'> <'\t> Z\n'> <'\t> expecting success: false\n'> <'\t> not ok 3 - failing test\n'> <'\t> #\tfalse\n'> <'\t> Z\n'> <'\t> # failed 1 among 3 test(s)\n'> <'\t> 1..3\n'> <'\tEOF\n'> ) } ) (C {(test_expect_success)} {(SQ <'test --verbose-only'>)} { (SQ <'\n'> <'\ttest_must_fail run_sub_test_lib_test \\\n'> <'\t\ttest-verbose-only-2 "test verbose-only=2" \\\n'> <'\t\t--verbose-only=2 <<-\\EOF &&\n'> <'\ttest_expect_success "passing test" true\n'> <'\ttest_expect_success "test with output" "echo foo"\n'> <'\ttest_expect_success "failing test" false\n'> <'\ttest_done\n'> <'\tEOF\n'> <'\tcheck_sub_test_lib_test test-verbose-only-2 <<-\\EOF\n'> <'\t> ok 1 - passing test\n'> <'\t> Z\n'> <'\t> expecting success: echo foo\n'> <'\t> foo\n'> <'\t> ok 2 - test with output\n'> <'\t> Z\n'> <'\t> not ok 3 - failing test\n'> <'\t> #\tfalse\n'> <'\t> # failed 1 among 3 test(s)\n'> <'\t> 1..3\n'> <'\tEOF\n'> ) } ) (C {(test_expect_success)} {(SQ <GIT_SKIP_TESTS>)} { (DQ ('\n') ('\t(\n') ("\t\tGIT_SKIP_TESTS='git.2' && export GIT_SKIP_TESTS &&\n") ('\t\trun_sub_test_lib_test git-skip-tests-basic ') ("\t\t\t'GIT_SKIP_TESTS' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\t\tfor i in 1 2 3\n') ('\t\tdo\n') ('\t\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\t\tdone\n') ('\t\ttest_done\n') ('\t\tEOF\n') ('\t\tcheck_sub_test_lib_test git-skip-tests-basic <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t\t> ok 1 - passing test #1\n') ('\t\t> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)\n') ('\t\t> ok 3 - passing test #3\n') ('\t\t> # passed all 3 test(s)\n') ('\t\t> 1..3\n') ('\t\tEOF\n') ('\t)\n') ) } ) (C {(test_expect_success)} {(SQ <'GIT_SKIP_TESTS several tests'>)} { (DQ ('\n') ('\t(\n') ("\t\tGIT_SKIP_TESTS='git.2 git.5' && export GIT_SKIP_TESTS &&\n") ('\t\trun_sub_test_lib_test git-skip-tests-several ') ("\t\t\t'GIT_SKIP_TESTS several tests' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\t\tfor i in 1 2 3 4 5 6\n') ('\t\tdo\n') ('\t\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\t\tdone\n') ('\t\ttest_done\n') ('\t\tEOF\n') ('\t\tcheck_sub_test_lib_test git-skip-tests-several <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t\t> ok 1 - passing test #1\n') ('\t\t> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)\n') ('\t\t> ok 3 - passing test #3\n') ('\t\t> ok 4 - passing test #4\n') ('\t\t> ok 5 # skip passing test #5 (GIT_SKIP_TESTS)\n') ('\t\t> ok 6 - passing test #6\n') ('\t\t> # passed all 6 test(s)\n') ('\t\t> 1..6\n') ('\t\tEOF\n') ('\t)\n') ) } ) (C {(test_expect_success)} {(SQ <'GIT_SKIP_TESTS sh pattern'>)} { (DQ ('\n') ('\t(\n') ("\t\tGIT_SKIP_TESTS='git.[2-5]' && export GIT_SKIP_TESTS &&\n") ('\t\trun_sub_test_lib_test git-skip-tests-sh-pattern ') ("\t\t\t'GIT_SKIP_TESTS sh pattern' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\t\tfor i in 1 2 3 4 5 6\n') ('\t\tdo\n') ('\t\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\t\tdone\n') ('\t\ttest_done\n') ('\t\tEOF\n') ('\t\tcheck_sub_test_lib_test git-skip-tests-sh-pattern <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t\t> ok 1 - passing test #1\n') ('\t\t> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)\n') ('\t\t> ok 3 # skip passing test #3 (GIT_SKIP_TESTS)\n') ('\t\t> ok 4 # skip passing test #4 (GIT_SKIP_TESTS)\n') ('\t\t> ok 5 # skip passing test #5 (GIT_SKIP_TESTS)\n') ('\t\t> ok 6 - passing test #6\n') ('\t\t> # passed all 6 test(s)\n') ('\t\t> 1..6\n') ('\t\tEOF\n') ('\t)\n') ) } ) (C {(test_expect_success)} {(SQ <'--run basic'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-basic ') ("\t\t'--run basic' --run='1 3 5' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-basic <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 # skip passing test #2 (--run)\n') ('\t> ok 3 - passing test #3\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with a range'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-range ') ("\t\t'--run with a range' --run='1-3' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-range <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 - passing test #3\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 # skip passing test #5 (--run)\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with two ranges'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-two-ranges ') ("\t\t'--run with two ranges' --run='1-2 5-6' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-two-ranges <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 - passing test #6\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with a left open range'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-left-open-range ') ("\t\t'--run with a left open range' --run='-3' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-left-open-range <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 - passing test #3\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 # skip passing test #5 (--run)\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with a right open range'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-right-open-range ') ("\t\t'--run with a right open range' --run='4-' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-right-open-range <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 # skip passing test #1 (--run)\n') ('\t> ok 2 # skip passing test #2 (--run)\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 - passing test #6\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with basic negation'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-basic-neg ') ("\t\t'--run with basic negation' --run='") ) (SQ <'!3'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-basic-neg <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 - passing test #6\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run with two negations'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-two-neg ') ("\t\t'--run with two negations' --run='")) (SQ <'!3 !6'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-two-neg <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run a range and negation'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-range-and-neg ') ("\t\t'--run a range and negation' --run='") ) (SQ <'-4 !2'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-range-and-neg <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 # skip passing test #2 (--run)\n') ('\t> ok 3 - passing test #3\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 # skip passing test #5 (--run)\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run range negation'>)} {(DQ ('\n') ('\trun_sub_test_lib_test run-range-neg ') ("\t\t'--run range negation' --run='")) (SQ <'!1-3'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-range-neg <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 # skip passing test #1 (--run)\n') ('\t> ok 2 # skip passing test #2 (--run)\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 - passing test #6\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run include, exclude and include'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-inc-neg-inc ') ("\t\t'--run include, exclude and include' ") ("\t\t--run='") ) (SQ <'1-5 !1-3 2'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-inc-neg-inc <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 # skip passing test #1 (--run)\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run include, exclude and include, comma separated'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-inc-neg-inc-comma ') ("\t\t'--run include, exclude and include, comma separated' ") ('\t\t--run=1-5,') (Lit_Other '\\') ('!1-3,2 <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-inc-neg-inc-comma <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 # skip passing test #1 (--run)\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 - passing test #4\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run exclude and include'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-neg-inc ') ("\t\t'--run exclude and include' ") ("\t\t--run='") ) (SQ <'!3- 5'>) (DQ ("' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-neg-inc <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 - passing test #2\n') ('\t> ok 3 # skip passing test #3 (--run)\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run empty selectors'>)} { (DQ ('\n') ('\trun_sub_test_lib_test run-empty-sel ') ("\t\t'--run empty selectors' ") ("\t\t--run='1,,3,,,5' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\tfor i in 1 2 3 4 5 6\n') ('\tdo\n') ('\t\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #') (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) (i) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\tdone\n') ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test run-empty-sel <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> ok 1 - passing test #1\n') ('\t> ok 2 # skip passing test #2 (--run)\n') ('\t> ok 3 - passing test #3\n') ('\t> ok 4 # skip passing test #4 (--run)\n') ('\t> ok 5 - passing test #5\n') ('\t> ok 6 # skip passing test #6 (--run)\n') ('\t> # passed all 6 test(s)\n') ('\t> 1..6\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'--run invalid range start'>)} { (DQ ('\n') ('\trun_sub_test_lib_test_err run-inv-range-start ') ("\t\t'--run invalid range start' ") ("\t\t--run='a-5' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #1') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test_err run-inv-range-start ') ('\t\t<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_OUT 3<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_ERR\n') ('\t> FATAL: Unexpected exit with code 1\n') ('\tEOF_OUT\n') ("\t> error: --run: invalid non-numeric in range start: 'a-5'\n") ('\tEOF_ERR\n') ) } ) (C {(test_expect_success)} {(SQ <'--run invalid range end'>)} { (DQ ('\n') ('\trun_sub_test_lib_test_err run-inv-range-end ') ("\t\t'--run invalid range end' ") ("\t\t--run='1-z' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #1') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test_err run-inv-range-end ') ('\t\t<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_OUT 3<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_ERR\n') ('\t> FATAL: Unexpected exit with code 1\n') ('\tEOF_OUT\n') ("\t> error: --run: invalid non-numeric in range end: '1-z'\n") ('\tEOF_ERR\n') ) } ) (C {(test_expect_success)} {(SQ <'--run invalid selector'>)} { (DQ ('\n') ('\trun_sub_test_lib_test_err run-inv-selector ') ("\t\t'--run invalid selector' ") ("\t\t--run='1?' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ('\ttest_expect_success ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('passing test #1') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (" 'true'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test_err run-inv-selector ') ('\t\t<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_OUT 3<<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF_ERR\n') ('\t> FATAL: Unexpected exit with code 1\n') ('\tEOF_OUT\n') ("\t> error: --run: invalid non-numeric in test selector: '1?'\n") ('\tEOF_ERR\n') ) } ) (C {(test_set_prereq)} {(HAVEIT)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:haveit spids:[1625]) op:Equal rhs:{(no)} spids:[1625])] spids: [1625] ) (C {(test_expect_success)} {(HAVEIT)} {(SQ <'test runs if prerequisite is satisfied'>)} {(SQ <'\n'> <'\ttest_have_prereq HAVEIT &&\n'> <'\thaveit=yes\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:donthaveit spids:[1642]) op: Equal rhs: {(yes)} spids: [1642] ) ] spids: [1642] ) (C {(test_expect_success)} {(DONTHAVEIT)} {(SQ <'unmet prerequisite causes test to be skipped'>)} {(SQ <'\n'> <'\tdonthaveit=no\n'>)} ) (If arms: [ (if_arm cond: [ (C {(test)} {($ VSub_Name '$haveit') ($ VSub_Name '$donthaveit')} {(KW_Bang '!') (Lit_Other '=')} {(yesyes)} ) ] action: [ (C {(say)} {(DQ ('bug in test framework: prerequisite tags do not work reliably'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1670] ) ] spids: [16777215 1684] ) (C {(test_set_prereq)} {(HAVETHIS)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:haveit spids:[1691]) op:Equal rhs:{(no)} spids:[1691])] spids: [1691] ) (C {(test_expect_success)} {(HAVETHIS) (Lit_Comma ',') (HAVEIT)} {(SQ <'test runs if prerequisites are satisfied'>)} { (SQ <'\n'> <'\ttest_have_prereq HAVEIT &&\n'> <'\ttest_have_prereq HAVETHIS &&\n'> <'\thaveit=yes\n'> ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:donthaveit spids:[1711]) op: Equal rhs: {(yes)} spids: [1711] ) ] spids: [1711] ) (C {(test_expect_success)} {(HAVEIT) (Lit_Comma ',') (DONTHAVEIT)} {(SQ <'unmet prerequisites causes test to be skipped'>)} {(SQ <'\n'> <'\tdonthaveit=no\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:donthaveiteither spids:[1729]) op: Equal rhs: {(yes)} spids: [1729] ) ] spids: [1729] ) (C {(test_expect_success)} {(DONTHAVEIT) (Lit_Comma ',') (HAVEIT)} {(SQ <'unmet prerequisites causes test to be skipped'>)} {(SQ <'\n'> <'\tdonthaveiteither=no\n'>)} ) (If arms: [ (if_arm cond: [ (C {(test)} {($ VSub_Name '$haveit') ($ VSub_Name '$donthaveit') ($ VSub_Name '$donthaveiteither')} {(KW_Bang '!') (Lit_Other '=')} {(yesyesyes)} ) ] action: [ (C {(say)} {(DQ ('bug in test framework: multiple prerequisite tags do not work reliably'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1760] ) ] spids: [16777215 1774] ) (C {(test_lazy_prereq)} {(LAZY_TRUE)} {(true)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:havetrue spids:[1783]) op:Equal rhs:{(no)} spids:[1783])] spids: [1783] ) (C {(test_expect_success)} {(LAZY_TRUE)} {(SQ <'test runs if lazy prereq is satisfied'>)} {(SQ <'\n'> <'\thavetrue=yes\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:donthavetrue spids:[1799]) op: Equal rhs: {(yes)} spids: [1799] ) ] spids: [1799] ) (C {(test_expect_success)} {(KW_Bang '!') (LAZY_TRUE)} {(SQ <'missing lazy prereqs skip tests'>)} {(SQ <'\n'> <'\tdonthavetrue=no\n'>)} ) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Name '$havetrue') ($ VSub_Name '$donthavetrue'))} {(KW_Bang '!') (Lit_Other '=')} {(yesyes)} ) ] action: [ (C {(say)} {(SQ <'bug in test framework: lazy prerequisites do not work'>)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1831] ) ] spids: [16777215 1845] ) (C {(test_lazy_prereq)} {(LAZY_FALSE)} {(false)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nothavefalse spids:[1854]) op: Equal rhs: {(no)} spids: [1854] ) ] spids: [1854] ) (C {(test_expect_success)} {(KW_Bang '!') (LAZY_FALSE)} {(SQ <'negative lazy prereqs checked'>)} {(SQ <'\n'> <'\tnothavefalse=yes\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:havefalse spids:[1871]) op: Equal rhs: {(yes)} spids: [1871] ) ] spids: [1871] ) (C {(test_expect_success)} {(LAZY_FALSE)} {(SQ <'missing negative lazy prereqs will skip'>)} {(SQ <'\n'> <'\thavefalse=no\n'>)} ) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ ($ VSub_Name '$nothavefalse') ($ VSub_Name '$havefalse'))} {(KW_Bang '!') (Lit_Other '=')} {(yesyes)} ) ] action: [ (C {(say)} {(SQ <'bug in test framework: negative lazy prerequisites do not work'>)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1902] ) ] spids: [16777215 1916] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:clean spids:[1919]) op:Equal rhs:{(no)} spids:[1919])] spids: [1919] ) (C {(test_expect_success)} {(SQ <'tests clean up after themselves'>)} {(SQ <'\n'> <'\ttest_when_finished clean=yes\n'>)} ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Name '$clean')} {(KW_Bang '!') (Lit_Other '=')} {(yes)})] action: [ (C {(say)} {(DQ ('bug in test framework: basic cleanup command does not work reliably'))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 1945] ) ] spids: [16777215 1959] ) (C {(test_expect_success)} {(SQ <'tests clean up even on failures'>)} { (DQ ('\n') ('\ttest_must_fail run_sub_test_lib_test ') ("\t\tfailing-cleanup 'Failing tests with cleanup commands' <<-") (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF &&\n') ("\ttest_expect_success 'tests clean up even after a failure' '\n") ('\t\ttouch clean-after-failure &&\n') ('\t\ttest_when_finished rm clean-after-failure &&\n') ('\t\t(exit 1)\n') ("\t'\n") ("\ttest_expect_success 'failure to clean up causes the test to fail' '\n") ('\t\ttest_when_finished ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('(exit 2)') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('\n') ("\t'\n") ('\ttest_done\n') ('\tEOF\n') ('\tcheck_sub_test_lib_test failing-cleanup <<-') (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) ('EOF\n') ('\t> not ok 1 - tests clean up even after a failure\n') ('\t> #\tZ\n') ('\t> #\ttouch clean-after-failure &&\n') ('\t> #\ttest_when_finished rm clean-after-failure &&\n') ('\t> #\t(exit 1)\n') ('\t> #\tZ\n') ('\t> not ok 2 - failure to clean up causes the test to fail\n') ('\t> #\tZ\n') ('\t> #\ttest_when_finished ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('(exit 2)') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('\n') ('\t> #\tZ\n') ('\t> # failed 2 among 2 test(s)\n') ('\t> 1..2\n') ('\tEOF\n') ) } ) (C {(test_expect_success)} {(SQ <'git update-index without --add should fail adding'>)} {(SQ <'\n'> <'\ttest_must_fail git update-index should-be-empty\n'>)} ) (C {(test_expect_success)} {(SQ <'git update-index with --add should succeed'>)} {(SQ <'\n'> <'\tgit update-index --add should-be-empty\n'>)} ) (C {(test_expect_success)} {(SQ <'writing tree out with git write-tree'>)} {(SQ <'\n'> <'\ttree=$(git write-tree)\n'>)} ) (C {(test_expect_success)} {(SQ <'validate object ID of a known tree'>)} {(SQ <'\n'> <'\ttest "$tree" = 7bb943559a305bdd6bdee2cef6e5df2413c3d30a\n'> <' '>)} ) (C {(test_expect_success)} {(SQ <'git update-index without --remove should fail removing'>)} { (SQ <'\n'> <'\trm -f should-be-empty full-of-directories &&\n'> <'\ttest_must_fail git update-index should-be-empty\n'> ) } ) (C {(test_expect_success)} {(SQ <'git update-index with --remove should be able to remove'>)} {(SQ <'\n'> <'\tgit update-index --remove should-be-empty\n'>)} ) (C {(test_expect_success)} {(SQ <'git write-tree should be able to write an empty tree'>)} {(SQ <'\n'> <'\ttree=$(git write-tree)\n'>)} ) (C {(test_expect_success)} {(SQ <'validate object ID of a known tree'>)} {(SQ <'\n'> <'\ttest "$tree" = $EMPTY_TREE\n'>)} ) (C {(test_expect_success)} {(SQ <'adding various types of objects with git update-index --add'>)} { (SQ <'\n'> <'\tmkdir path2 path3 path3/subp3 &&\n'> <'\tpaths="path0 path2/file2 path3/file3 path3/subp3/file3" &&\n'> <'\t(\n'> <'\t\tfor p in $paths\n'> <'\t\tdo\n'> <'\t\t\techo "hello $p" >$p || exit 1\n'> <'\t\t\ttest_ln_s_add "hello $p" ${p}sym || exit 1\n'> <'\t\tdone\n'> <'\t) &&\n'> <'\tfind path* ! -type d -print | xargs git update-index --add\n'> ) } ) (C {(test_expect_success)} {(SQ <'showing stage with git ls-files --stage'>)} {(SQ <'\n'> <'\tgit ls-files --stage >current\n'>)} ) (C {(test_expect_success)} {(SQ <'validate git ls-files output for a known tree'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t100644 f87290f8eb2cbbea7857214459a0739927eab154 0\tpath0\n'> <'\t120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0\tpath0sym\n'> <'\t100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0\tpath2/file2\n'> <'\t120000 d8ce161addc5173867a3c3c730924388daedbc38 0\tpath2/file2sym\n'> <'\t100644 0aa34cae68d0878578ad119c86ca2b5ed5b28376 0\tpath3/file3\n'> <'\t120000 8599103969b43aff7e430efea79ca4636466794f 0\tpath3/file3sym\n'> <'\t100644 00fb5908cb97c2564a9783c0c64087333b3b464f 0\tpath3/subp3/file3\n'> <'\t120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0\tpath3/subp3/file3sym\n'> <'\tEOF\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'writing tree out with git write-tree'>)} {(SQ <'\n'> <'\ttree=$(git write-tree)\n'>)} ) (C {(test_expect_success)} {(SQ <'validate object ID for a known tree'>)} {(SQ <'\n'> <'\ttest "$tree" = 087704a96baf1c2d1c869a8b084481e121c88b5b\n'>)} ) (C {(test_expect_success)} {(SQ <'showing tree with git ls-tree'>)} {(SQ <'\n'> <' git ls-tree $tree >current\n'>)} ) (C {(test_expect_success)} {(SQ <'git ls-tree output for a known tree'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n'> <'\t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n'> <'\t040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe\tpath2\n'> <'\t040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3\tpath3\n'> <'\tEOF\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'showing tree with git ls-tree -r'>)} {(SQ <'\n'> <'\tgit ls-tree -r $tree >current\n'>)} ) (C {(test_expect_success)} {(SQ <'git ls-tree -r output for a known tree'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n'> <'\t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n'> <'\t100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7\tpath2/file2\n'> <'\t120000 blob d8ce161addc5173867a3c3c730924388daedbc38\tpath2/file2sym\n'> <'\t100644 blob 0aa34cae68d0878578ad119c86ca2b5ed5b28376\tpath3/file3\n'> <'\t120000 blob 8599103969b43aff7e430efea79ca4636466794f\tpath3/file3sym\n'> <'\t100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f\tpath3/subp3/file3\n'> <'\t120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c\tpath3/subp3/file3sym\n'> <'\tEOF\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'showing tree with git ls-tree -r -t'>)} {(SQ <'\n'> <'\tgit ls-tree -r -t $tree >current\n'>)} ) (C {(test_expect_success)} {(SQ <'git ls-tree -r output for a known tree'>)} { (SQ <'\n'> <'\tcat >expected <<-\\EOF &&\n'> <'\t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n'> <'\t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n'> <'\t040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe\tpath2\n'> <'\t100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7\tpath2/file2\n'> <'\t120000 blob d8ce161addc5173867a3c3c730924388daedbc38\tpath2/file2sym\n'> <'\t040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3\tpath3\n'> <'\t100644 blob 0aa34cae68d0878578ad119c86ca2b5ed5b28376\tpath3/file3\n'> <'\t120000 blob 8599103969b43aff7e430efea79ca4636466794f\tpath3/file3sym\n'> <'\t040000 tree 3c5e5399f3a333eddecce7a9b9465b63f65f51e2\tpath3/subp3\n'> <'\t100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f\tpath3/subp3/file3\n'> <'\t120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c\tpath3/subp3/file3sym\n'> <'\tEOF\n'> <'\ttest_cmp expected current\n'> ) } ) (C {(test_expect_success)} {(SQ <'writing partial tree out with git write-tree --prefix'>)} {(SQ <'\n'> <'\tptree=$(git write-tree --prefix=path3)\n'>)} ) (C {(test_expect_success)} {(SQ <'validate object ID for a known tree'>)} {(SQ <'\n'> <'\ttest "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3\n'>)} ) (C {(test_expect_success)} {(SQ <'writing partial tree out with git write-tree --prefix'>)} {(SQ <'\n'> <'\tptree=$(git write-tree --prefix=path3/subp3)\n'>)} ) (C {(test_expect_success)} {(SQ <'validate object ID for a known tree'>)} {(SQ <'\n'> <'\ttest "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n'>)} ) (C {(test_expect_success)} {(SQ <'put invalid objects into the index'>)} { (SQ <'\n'> <'\trm -f .git/index &&\n'> <'\tcat >badobjects <<-\\EOF &&\n'> <'\t100644 blob 1000000000000000000000000000000000000000\tdir/file1\n'> <'\t100644 blob 2000000000000000000000000000000000000000\tdir/file2\n'> <'\t100644 blob 3000000000000000000000000000000000000000\tdir/file3\n'> <'\t100644 blob 4000000000000000000000000000000000000000\tdir/file4\n'> <'\t100644 blob 5000000000000000000000000000000000000000\tdir/file5\n'> <'\tEOF\n'> <'\tgit update-index --index-info <badobjects\n'> ) } ) (C {(test_expect_success)} {(SQ <'writing this tree without --missing-ok'>)} {(SQ <'\n'> <'\ttest_must_fail git write-tree\n'>)} ) (C {(test_expect_success)} {(SQ <'writing this tree with --missing-ok'>)} {(SQ <'\n'> <'\tgit write-tree --missing-ok\n'>)} ) (C {(test_expect_success)} {(SQ <'git read-tree followed by write-tree should be idempotent'>)} { (SQ <'\n'> <'\trm -f .git/index &&\n'> <'\tgit read-tree $tree &&\n'> <'\ttest -f .git/index &&\n'> <'\tnewtree=$(git write-tree) &&\n'> <'\ttest "$newtree" = "$tree"\n'> ) } ) (C {(test_expect_success)} {(SQ <'validate git diff-files output for a know cache/work tree state'>)} { (SQ <'\n'> <'\tcat >expected <<\\EOF &&\n'> < ':100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M\tpath0\n' > < ':120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M\tpath0sym\n' > < ':100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M\tpath2/file2\n' > < ':120000 120000 d8ce161addc5173867a3c3c730924388daedbc38 0000000000000000000000000000000000000000 M\tpath2/file2sym\n' > < ':100644 100644 0aa34cae68d0878578ad119c86ca2b5ed5b28376 0000000000000000000000000000000000000000 M\tpath3/file3\n' > < ':120000 120000 8599103969b43aff7e430efea79ca4636466794f 0000000000000000000000000000000000000000 M\tpath3/file3sym\n' > < ':100644 100644 00fb5908cb97c2564a9783c0c64087333b3b464f 0000000000000000000000000000000000000000 M\tpath3/subp3/file3\n' > < ':120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n' > <'EOF\n'> <'\tgit diff-files >current &&\n'> <'\ttest_cmp current expected\n'> ) } ) (C {(test_expect_success)} {(SQ <'git update-index --refresh should succeed'>)} {(SQ <'\n'> <'\tgit update-index --refresh\n'>)} ) (C {(test_expect_success)} {(SQ <'no diff after checkout and git update-index --refresh'>)} {(SQ <'\n'> <'\tgit diff-files >current &&\n'> <'\tcmp -s current /dev/null\n'>)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P spids:[2491]) op: Equal rhs: {(087704a96baf1c2d1c869a8b084481e121c88b5b)} spids: [2491] ) ] spids: [2491] ) (C {(test_expect_success)} {(SQ <'git commit-tree records the correct tree in a commit'>)} { (SQ <'\n'> <'\tcommit0=$(echo NO | git commit-tree $P) &&\n'> <'\ttree=$(git show --pretty=raw $commit0 |\n'> <'\t\t sed -n -e "s/^tree //p" -e "/^author /q") &&\n'> <'\ttest "z$tree" = "z$P"\n'> ) } ) (C {(test_expect_success)} {(SQ <'git commit-tree records the correct parent in a commit'>)} { (SQ <'\n'> <'\tcommit1=$(echo NO | git commit-tree $P -p $commit0) &&\n'> <'\tparent=$(git show --pretty=raw $commit1 |\n'> <'\t\tsed -n -e "s/^parent //p" -e "/^author /q") &&\n'> <'\ttest "z$commit0" = "z$parent"\n'> ) } ) (C {(test_expect_success)} {(SQ <'git commit-tree omits duplicated parent in a commit'>)} { (SQ <'\n'> <'\tcommit2=$(echo NO | git commit-tree $P -p $commit0 -p $commit0) &&\n'> <'\t parent=$(git show --pretty=raw $commit2 |\n'> <'\t\tsed -n -e "s/^parent //p" -e "/^author /q" |\n'> <'\t\tsort -u) &&\n'> <'\ttest "z$commit0" = "z$parent" &&\n'> <'\tnumparent=$(git show --pretty=raw $commit2 |\n'> <'\t\tsed -n -e "s/^parent //p" -e "/^author /q" |\n'> <'\t\twc -l) &&\n'> <'\ttest $numparent = 1\n'> ) } ) (C {(test_expect_success)} {(SQ <'update-index D/F conflict'>)} { (SQ <'\n'> <'\tmv path0 tmp &&\n'> <'\tmv path2 path0 &&\n'> <'\tmv tmp path2 &&\n'> <'\tgit update-index --add --replace path2 path0/file2 &&\n'> <'\tnumpath0=$(git ls-files path0 | wc -l) &&\n'> <'\ttest $numpath0 = 1\n'> ) } ) (C {(test_expect_success)} {(SQ <'very long name in the index handled sanely'>)} { (SQ <'\n'> <'\n'> <'\ta=a && # 1\n'> <'\ta=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 16\n'> <'\ta=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 256\n'> <'\ta=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 4096\n'> <'\ta=${a}q &&\n'> <'\n'> <'\t>path4 &&\n'> <'\tgit update-index --add path4 &&\n'> <'\t(\n'> <'\t\tgit ls-files -s path4 |\n'> <'\t\tsed -e "s/\t.*/\t/" |\n'> <'\t\ttr -d "\\012"\n'> <'\t\techo "$a"\n'> <'\t) | git update-index --index-info &&\n'> <'\tlen=$(git ls-files "a*" | wc -c) &&\n'> <'\ttest $len = 4098\n'> ) } ) (C {(test_done)}) ] )