(List (= scope= flags=0 words=[] bindings=[('test_description', {[DQ [LIT_CHARS "Test whether cache-tree is properly updated\n"][LIT_CHARS "\n"][LIT_CHARS "Tests whether various commands properly update and/or rewrite the\n"][LIT_CHARS "cache-tree extension.\n"]]})]) (Com {[LIT_CHARS .]} {[LIT_CHARS ./test-lib.sh]}) (FunctionDef cmp_cache_tree [] (AndOr OP_AND_IF (Pipeline (Com {[LIT_CHARS test-dump-cache-tree]}) (Com {[LIT_CHARS sed]} {[LIT_CHARS -e]} {[SQ ]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} "> 1), > ) ) (AndOr OP_AND_IF (Com {[LIT_CHARS sed]} {[DQ [LIT_CHARS s/][VarSub _x40][LIT_CHARS /SHA/]]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} 0), (FilenameRedirectNode filename={[LIT_CHARS filtered]} "> 1), > ) (Com {[LIT_CHARS test_cmp]} {[DQ [VarSub 1]]} {[LIT_CHARS filtered]}) ) ) ) (FunctionDef generate_expected_cache_tree_rec [] (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('dir', {[DQ [VarSub 1][VarSub 1 test_op=VS_TEST_COLON_PLUS {[LIT_SLASH /]}]]})]) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('parent', {[DQ [VarSub 2]]})]) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('subtrees', {[ComSub (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS ls-files]}) (Com {[LIT_CHARS grep]} {[LIT_CHARS /]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -d]} {[LIT_CHARS /]} {[LIT_CHARS -f]} {[LIT_CHARS 1]}) (Com {[LIT_CHARS uniq]}) )]})]) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('subtree_count', {[ComSub (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub subtrees]]}) (Com {[LIT_CHARS awk]} {[LIT_CHARS -v]} {[LIT_VAR_LIKE "c="] [LIT_CHARS 0] =} {[SQ ]}) )]})]) (AndOr OP_AND_IF (= scope= flags=0 words=[] bindings=[('entries', {[ComSub (Pipeline (Com {[LIT_CHARS git]} {[LIT_CHARS ls-files]}) (Com {[LIT_CHARS wc]} {[LIT_CHARS -l]}) )]})]) (AndOr OP_AND_IF (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "SHA "][VarSub dir][LIT_CHARS " (%d entries, %d subtrees)"][\ LIT_ESCAPED_CHAR "\\n"]]} {[DQ [VarSub entries]]} {[DQ [VarSub subtree_count]]}) (AndOr OP_AND_IF (For subtree [{[VarSub subtrees]}]) (List (Com {[LIT_CHARS cd]} {[DQ [VarSub subtree]]}) (AndOr OP_OR_IF (Com {[LIT_CHARS generate_expected_cache_tree_rec]} {[DQ [VarSub dir][VarSub subtree]]} {[DQ [VarSub dir]]}) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]}) ) (Com {[LIT_CHARS cd]} {[LIT_CHARS ..]}) ) ) (= scope= flags=0 words=[] bindings=[('dir', {[VarSub parent]})]) ) ) ) ) ) ) ) ) (FunctionDef generate_expected_cache_tree [] (Subshell (Com {[LIT_CHARS generate_expected_cache_tree_rec]}) ) ) (FunctionDef test_cache_tree [] (AndOr OP_AND_IF (Com {[LIT_CHARS generate_expected_cache_tree]} < (FilenameRedirectNode filename={[LIT_CHARS expect]} "> 1), > ) (Com {[LIT_CHARS cmp_cache_tree]} {[LIT_CHARS expect]}) ) ) (FunctionDef test_invalid_cache_tree [] (AndOr OP_AND_IF (Com {[LIT_CHARS printf]} {[DQ [LIT_CHARS "invalid %s ()"][\ LIT_ESCAPED_CHAR "\\n"]]} {[DQ ]} {[DQ [VarSub @]]} < (FilenameRedirectNode filename={[LIT_CHARS expect]} "> 1), > ) (AndOr OP_AND_IF (Pipeline (Com {[LIT_CHARS test-dump-cache-tree]}) (Com {[LIT_CHARS sed]} {[LIT_CHARS -n]} {[LIT_CHARS -e]} {[DQ [LIT_CHARS "s/[0-9]* subtrees//"]]} {[LIT_CHARS -e]} {[SQ ]} {[LIT_CHARS -e]} {[SQ ]} < (FilenameRedirectNode filename={[LIT_CHARS actual]} "> 1), > ) ) (Com {[LIT_CHARS test_cmp]} {[LIT_CHARS expect]} {[LIT_CHARS actual]}) ) ) ) (FunctionDef test_no_cache_tree [] (AndOr OP_AND_IF (Com {[LIT_OTHER ":"]} < (FilenameRedirectNode filename={[LIT_CHARS expect]} "> 1), > ) (Com {[LIT_CHARS cmp_cache_tree]} {[LIT_CHARS expect]}) ) ) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ foo &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ dirx/foo &&\n"> ]}) (Com {[LIT_CHARS cat]} < (FilenameRedirectNode filename={[LIT_CHARS before]} "> 1), (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "SHA (3 entries, 2 subtrees)\n"] [LIT_CHARS "SHA dir1/ (1 entries, 0 subtrees)\n"] [LIT_CHARS "SHA dir2/ (1 entries, 0 subtrees)\n"]} 0), > ) (Com {[LIT_CHARS cat]} < (FilenameRedirectNode filename={[LIT_CHARS expect]} "> 1), (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "invalid (2 subtrees)\n"] [LIT_CHARS "invalid dir1/ (0 subtrees)\n"] [LIT_CHARS "SHA dir2/ (1 entries, 0 subtrees)\n"]} 0), > ) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ dir1/a &&\n"> dir1/a &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ foo &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[LIT_CHARS PERL]} {[SQ ]} {[SQ foo.c &&\n"> foo.c &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ dir/child.t &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ one.t &&\n"> two.t &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ newdir/one &&\n"> errors &&\n"> ]}) (Com {[LIT_CHARS test_expect_success]} {[SQ ]} {[SQ split &&\n"> before &&\n"> after &&\n"> ]}) (Com {[LIT_CHARS test_done]}) )