(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'test @{-N} syntax'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: make_commit body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(echo)} {(DQ ($ VSub_Number '$1'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$1'))} ) ] ) (C {(git)} {(add)} {(DQ ($ VSub_Number '$1'))}) (C {(git)} {(commit)} {(-m)} {(DQ ($ VSub_Number '$1'))}) ] ) ] ) ) (C {(test_expect_success)} {(SQ <setup>)} { (SQ <'\n'> <'\n'> <'\tmake_commit 1 &&\n'> <'\tgit branch side &&\n'> <'\tmake_commit 2 &&\n'> <'\tmake_commit 3 &&\n'> <'\tgit checkout side &&\n'> <'\tmake_commit 4 &&\n'> <'\tgit merge master &&\n'> <'\tgit checkout master\n'> <'\n'> ) } ) (C {(test_expect_success)} {(SQ <'@{-1} works'>)} {(SQ <'\n'> <'\ttest_cmp_rev side @{-1}\n'>)}) (C {(test_expect_success)} {(SQ <'@{-1}~2 works'>)} {(SQ <'\n'> <'\ttest_cmp_rev side~2 @{-1}~2\n'>)}) (C {(test_expect_success)} {(SQ <'@{-1}^2 works'>)} {(SQ <'\n'> <'\ttest_cmp_rev side^2 @{-1}^2\n'>)}) (C {(test_expect_success)} {(SQ <'@{-1}@{1} works'>)} {(SQ <'\n'> <'\ttest_cmp_rev side@{1} @{-1}@{1}\n'>)} ) (C {(test_expect_success)} {(SQ <'@{-2} works'>)} {(SQ <'\n'> <'\ttest_cmp_rev master @{-2}\n'>)}) (C {(test_expect_success)} {(SQ <'@{-3} fails'>)} {(SQ <'\n'> <'\ttest_must_fail git rev-parse @{-3}\n'>)} ) (C {(test_done)}) ] )