(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"apply with fuzz and offset">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: dotest body: (BraceGroup children: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [23] ) ] spids: [23] ) (AndOr children: [ (C {(shift)}) (C {(test_expect_success)} {(DQ ($ VSub_Name "$name"))} { (DQ ("\n") ("\t\tgit checkout-index -f -q -u file &&\n") ("\t\tgit apply ") ($ VSub_Star "$*") (" &&\n") ("\t\ttest_cmp expect file\n") ("\t") ) } ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [20] ) spids: [15 19] ) (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)}) ] )