(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'apply with fuzz and offset'>)} spids: [4] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (command.ShFunction name: dotest body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$1'))} spids: [23] ) ] ) (C {<shift>}) (C {<test_expect_success>} {(DQ ($ Id.VSub_DollarName '$name'))} { (DQ <'\n'> <'\t\tgit checkout-index -f -q -u file &&\n'> <'\t\tgit apply '> ($ Id.VSub_Star '$*') <' &&\n'> <'\t\ttest_cmp expect file\n'> <'\t'> ) } ) ] ) ] ) ) (C {<test_expect_success>} {<setup>} { (SQ <'\n'> <'\n'> <'\tfor i in 1 2 3 4 5 6 7 8 9 10 11 12\n'> <'\tdo\n'> <'\t\techo $i\n'> <'\tdone >file &&\n'> <'\tgit update-index --add file &&\n'> <'\tfor i in 1 2 3 4 5 6 7 a b c d e 8 9 10 11 12\n'> <'\tdo\n'> <'\t\techo $i\n'> <'\tdone >file &&\n'> <'\tcat file >expect &&\n'> <'\tgit diff >O0.diff &&\n'> <'\n'> <'\tsed -e "s/@@ -5,6 +5,11 @@/@@ -2,6 +2,11 @@/" >O1.diff O0.diff &&\n'> <'\tsed -e "s/@@ -5,6 +5,11 @@/@@ -7,6 +7,11 @@/" >O2.diff O0.diff &&\n'> <'\tsed -e "s/@@ -5,6 +5,11 @@/@@ -19,6 +19,11 @@/" >O3.diff O0.diff &&\n'> <'\n'> <'\tsed -e "s/^ 5/ S/" >F0.diff O0.diff &&\n'> <'\tsed -e "s/^ 5/ S/" >F1.diff O1.diff &&\n'> <'\tsed -e "s/^ 5/ S/" >F2.diff O2.diff &&\n'> <'\tsed -e "s/^ 5/ S/" >F3.diff O3.diff\n'> <'\n'> ) } ) (C {<dotest>} {(SQ <'unmodified patch'>)} {<O0.diff>}) (C {<dotest>} {(SQ <'minus offset'>)} {<O1.diff>}) (C {<dotest>} {(SQ <'plus offset'>)} {<O2.diff>}) (C {<dotest>} {(SQ <'big offset'>)} {<O3.diff>}) (C {<dotest>} {(SQ <'fuzz with no offset'>)} {<-C2>} {<F0.diff>}) (C {<dotest>} {(SQ <'fuzz with minus offset'>)} {<-C2>} {<F1.diff>}) (C {<dotest>} {(SQ <'fuzz with plus offset'>)} {<-C2>} {<F2.diff>}) (C {<dotest>} {(SQ <'fuzz with big offset'>)} {<-C2>} {<F3.diff>}) (C {<test_done>}) ] )