(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'log family learns --stdin'>)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: check body: (BraceGroup children: [ (ForEach iter_name: cmd iter_words: [{(rev-list)} {(DQ ('log --stat'))}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (ForEach iter_name: i iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: False body: (DoGroup children: [ (C {(printf)} {(DQ ('%s') (EscapedLiteralPart token:<Lit_EscapedChar '\\n'>))} {($ VSub_Name '$i')} ) ] spids: [59 72] ) redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(input)} spids:[74])] spids: [53 -1] ) (C {(test_expect_success)} {(DQ ('check ') ($ VSub_Name '$cmd') (' ') ($ VSub_Star '$*'))} { (SQ <'\n'> <'\t\t\tgit $cmd $(cat input) >expect &&\n'> <'\t\t\tgit $cmd --stdin <input >actual &&\n'> <'\t\t\tsed -e "s/^/input /" input &&\n'> <'\t\t\tsed -e "s/^/output /" expect &&\n'> <'\t\t\ttest_cmp expect actual\n'> <'\t\t'> ) } ) ] op_id: Op_DAmp ) ] spids: [45 100] ) spids: [37 -1] ) ] spids: [29] ) spids: [24 28] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:them) op:Equal rhs:{(SQ <'1 2 3 4 5 6 7'>)} spids:[105])] spids: [105] ) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\t(\n'> <'\t\tfor i in 0 $them\n'> <'\t\tdo\n'> <'\t\t\tfor j in $them\n'> <'\t\t\tdo\n'> <'\t\t\t\techo $i.$j >file-$j &&\n'> <'\t\t\t\tgit add file-$j || exit\n'> <'\t\t\tdone &&\n'> <'\t\t\ttest_tick &&\n'> <'\t\t\tgit commit -m $i || exit\n'> <'\t\tdone &&\n'> <'\t\tfor i in $them\n'> <'\t\tdo\n'> <'\t\t\tgit checkout -b side-$i master~$i &&\n'> <'\t\t\techo updated $i >file-$i &&\n'> <'\t\t\tgit add file-$i &&\n'> <'\t\t\ttest_tick &&\n'> <'\t\t\tgit commit -m side-$i || exit\n'> <'\t\tdone\n'> <'\t)\n'> ) } ) (C {(check)} {(master)}) (C {(check)} {(side-1)} {(Lit_Other '^') (side-4)}) (C {(check)} {(side-1)} {(Lit_Other '^') (side-7)} {(--)}) (C {(check)} {(side-1)} {(Lit_Other '^') (side-7)} {(--)} {(file-1)}) (C {(check)} {(side-1)} {(Lit_Other '^') (side-7)} {(--)} {(file-2)}) (C {(check)} {(side-3)} {(Lit_Other '^') (side-4)} {(--)} {(file-3)}) (C {(check)} {(side-3)} {(Lit_Other '^') (side-2)}) (C {(check)} {(side-3)} {(Lit_Other '^') (side-2)} {(--)} {(file-1)}) (C {(test_expect_success)} {(SQ <'not only --stdin'>)} { (SQ <'\n'> <'\tcat >expect <<-EOF &&\n'> <'\t7\n'> <'\n'> <'\tfile-1\n'> <'\tfile-2\n'> <'\tEOF\n'> <'\tcat >input <<-EOF &&\n'> <'\t^master^\n'> <'\t--\n'> <'\tfile-2\n'> <'\tEOF\n'> <'\tgit log --pretty=tformat:%s --name-only --stdin master -- file-1 \\\n'> <'\t\t<input >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_done)}) ] )