(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'git-apply notices removal patches generated by GNU diff'>)}
          spids: [10]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (C {<test_expect_success>} {<setup>} 
      {
        (SQ <'\n'> <'\tcat <<-EOF >c &&\n'> <'\tdiff -ruN a/file b/file\n'> <'\t--- a/file\tTS0\n'> 
          <'\t+++ b/file\tTS1\n'> <'\t@@ -0,0 +1 @@\n'> <'\t+something\n'> <'\tEOF\n'> <'\n'> <'\tcat <<-EOF >d &&\n'> 
          <'\tdiff -ruN a/file b/file\n'> <'\t--- a/file\tTS0\n'> <'\t+++ b/file\tTS1\n'> <'\t@@ -1 +0,0 @@\n'> <'\t-something\n'> <'\tEOF\n'> 
          <'\n'> <'\ttimeWest="1982-09-16 07:00:00.000000000 -0800" &&\n'> 
          <'\t timeGMT="1982-09-16 15:00:00.000000000 +0000" &&\n'> <'\ttimeEast="1982-09-17 00:00:00.000000000 +0900" &&\n'> <'\n'> 
          <'\tepocWest="1969-12-31 16:00:00.000000000 -0800" &&\n'> <'\t epocGMT="1970-01-01 00:00:00.000000000 +0000" &&\n'> 
          <'\tepocEast="1970-01-01 09:00:00.000000000 +0900" &&\n'> <'\tepocWest2="1969-12-31 16:00:00 -08:00" &&\n'> <'\n'> 
          <'\tsed -e "s/TS0/$epocWest/" -e "s/TS1/$timeWest/" <c >createWest.patch &&\n'> <'\tsed -e "s/TS0/$epocEast/" -e "s/TS1/$timeEast/" <c >createEast.patch &&\n'> 
          <'\tsed -e "s/TS0/$epocGMT/" -e "s/TS1/$timeGMT/" <c >createGMT.patch &&\n'> <'\n'> <'\tsed -e "s/TS0/$timeWest/" -e "s/TS1/$timeWest/" <c >addWest.patch &&\n'> 
          <'\tsed -e "s/TS0/$timeEast/" -e "s/TS1/$timeEast/" <c >addEast.patch &&\n'> <'\tsed -e "s/TS0/$timeGMT/" -e "s/TS1/$timeGMT/" <c >addGMT.patch &&\n'> <'\n'> 
          <'\tsed -e "s/TS0/$timeWest/" -e "s/TS1/$timeWest/" <d >emptyWest.patch &&\n'> <'\tsed -e "s/TS0/$timeEast/" -e "s/TS1/$timeEast/" <d >emptyEast.patch &&\n'> 
          <'\tsed -e "s/TS0/$timeGMT/" -e "s/TS1/$timeGMT/" <d >emptyGMT.patch &&\n'> <'\n'> <'\tsed -e "s/TS0/$timeWest/" -e "s/TS1/$epocWest/" <d >removeWest.patch &&\n'> 
          <'\tsed -e "s/TS0/$timeEast/" -e "s/TS1/$epocEast/" <d >removeEast.patch &&\n'> <'\tsed -e "s/TS0/$timeGMT/" -e "s/TS1/$epocGMT/" <d >removeGMT.patch &&\n'> 
          <'\tsed -e "s/TS0/$timeWest/" -e "s/TS1/$epocWest2/" <d >removeWest2.patch &&\n'> <'\n'> <'\techo something >something &&\n'> <'\t>empty\n'>
        )
      }
    )
    (command.ForEach
      iter_names: [patch]
      iterable: (for_iter.Words words:[{<Id.Lit_Star '*'> <.patch>}])
      body: 
        (command.DoGroup
          children: [
            (C {<test_expect_success>} {(DQ <'test '> ($ Id.VSub_DollarName '$patch'))} 
              {
                (SQ <'\n'> <'\t\trm -f file .git/index &&\n'> <'\t\tcase "$patch" in\n'> 
                  <'\t\tcreate*)\n'> <'\t\t\t# must be able to create\n'> <'\t\t\tgit apply --index $patch &&\n'> 
                  <'\t\t\ttest_cmp file something &&\n'> <'\t\t\t# must notice the file is already there\n'> <'\t\t\t>file &&\n'> <'\t\t\tgit add file &&\n'> 
                  <'\t\t\ttest_must_fail git apply $patch\n'> <'\t\t\t;;\n'> <'\t\tadd*)\n'> <'\t\t\t# must be able to create or patch\n'> 
                  <'\t\t\tgit apply $patch &&\n'> <'\t\t\ttest_cmp file something &&\n'> <'\t\t\t>file &&\n'> <'\t\t\tgit apply $patch &&\n'> 
                  <'\t\t\ttest_cmp file something\n'> <'\t\t\t;;\n'> <'\t\tempty*)\n'> <'\t\t\t# must leave an empty file\n'> 
                  <'\t\t\tcat something >file &&\n'> <'\t\t\tgit add file &&\n'> <'\t\t\tgit apply --index $patch &&\n'> <'\t\t\ttest -f file &&\n'> 
                  <'\t\t\ttest_cmp empty file\n'> <'\t\t\t;;\n'> <'\t\tremove*)\n'> <'\t\t\t# must remove the file\n'> <'\t\t\tcat something >file &&\n'> 
                  <'\t\t\tgit add file &&\n'> <'\t\t\tgit apply --index $patch &&\n'> <'\t\t\t! test -f file\n'> <'\t\t\t;;\n'> <'\t\tesac\n'> <'\t'>
                )
              }
            )
          ]
        )
    )
    (C {<test_done>})
  ]
)