(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: 
            {
              (SQ (Token id:Id.Lit_Chars val:'git-apply --ignore-whitespace.\n' span_id:15) 
                (Token id:Id.Lit_Chars val:'\n' span_id:16)
              )
            }
          spids: [13]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:33)
          fd: -1
          arg_word: {(patch1.patch)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:37)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:38)) (OF)}
          here_end_span_id: 68
          stdin_parts: [
            ('diff --git a/main.c b/main.c\n')
            ('new file mode 100644\n')
            ('--- /dev/null\n')
            ('+++ b/main.c\n')
            ('@@ -0,0 +1,22 @@\n')
            ('+#include <stdio.h>\n')
            ('+\n')
            ('+void print_int(int num);\n')
            ('+int func(int num);\n')
            ('+\n')
            ('+int main() {\n')
            ('+       int i;\n')
            ('+\n')
            ('+       for (i = 0; i < 10; i++) {\n')
            ('+               print_int(func(i)); /* stuff */\n')
            ('+       }\n')
            ('+\n')
            ('+       return 0;\n')
            ('+}\n')
            ('+\n')
            ('+int func(int num) {\n')
            ('+       return num * num;\n')
            ('+}\n')
            ('+\n')
            ('+void print_int(int num) {\n')
            ('+       printf("%d", num);\n')
            ('+}\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/Z/ /g' span_id:92))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:95)
          fd: -1
          arg_word: {(patch2.patch)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:99)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:100)) 
              (OF)
            }
          here_end_span_id: 115
          stdin_parts: [
            ('diff --git a/main.c b/main.c\n')
            ('--- a/main.c\n')
            ('+++ b/main.c\n')
            ('@@ -10,6 +10,8 @@\n')
            ('Z\t\tprint_int(func(i)); /* stuff */\n')
            ('Z\t}\n')
            ('Z\n')
            ('+\tprintf("\\n");\n')
            ('+\n')
            ('Z\treturn 0;\n')
            ('Z}\n')
            ('Z\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/Z/ /g' span_id:135))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:138)
          fd: -1
          arg_word: {(patch3.patch)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:142)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:143)) 
              (OF)
            }
          here_end_span_id: 154
          stdin_parts: [
            ('diff --git a/main.c b/main.c\n')
            ('--- a/main.c\n')
            ('+++ b/main.c\n')
            ('@@ -10,3 +10,4 @@\n')
            ('Z\tfor (i = 0; i < 10; i++) {\n')
            ('Z\t\tprint_int(func(i));Z\n')
            ('+\t\t/* stuff */\n')
            ('Z\t}\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/Z/ /g' span_id:168))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:171)
          fd: -1
          arg_word: {(patch4.patch)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:175)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:176)) 
              (OF)
            }
          here_end_span_id: 186
          stdin_parts: [
            ('diff --git a/main.c b/main.c\n')
            ('--- a/main.c\n')
            ('+++ b/main.c\n')
            ('@@ -21,1 +21,1 @@\n')
            ('-\t};Z\n')
            ('\\ No newline at end of file\n')
            ('+\t};\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/Z/ /g' span_id:197))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:200)
          fd: -1
          arg_word: {(patch5.patch)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:204)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:205)) 
              (OF)
            }
          here_end_span_id: 215
          stdin_parts: [
            ('diff --git a/main.c b/main.c\n')
            ('--- a/main.c\n')
            ('+++ b/main.c\n')
            ('@@ -2,2 +2,3 @@\n')
            ('Z\tvoid print_int(int num);\n')
            ('+\t/* a comment */\n')
            ('Z\tint func(int num);\n')
          ]
        )
      ]
    )
    (command.Simple
      words: [{(sed)} {(-e)} {(SQ (Token id:Id.Lit_Chars val:'s/T/\t/g' span_id:229))}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:232)
          fd: -1
          arg_word: {(main.c.final)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:236)
          fd: -1
          here_begin: 
            {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:237)) 
              (OF)
            }
          here_end_span_id: 264
          stdin_parts: [
            ('#include <stdio.h>\n')
            ('\n')
            ('void print_int(int num);\n')
            ('int func(int num);\n')
            ('\n')
            ('int main() {\n')
            ('       int i;\n')
            ('\n')
            ('       for (i = 0; i < 10; i++) {\n')
            ('               print_int(func(i)); /* stuff */\n')
            ('       }\n')
            ('\n')
            ('Tprintf("\\n");\n')
            ('\n')
            ('       return 0;\n')
            ('}\n')
            ('\n')
            ('int func(int num) {\n')
            ('       return num * num;\n')
            ('}\n')
            ('\n')
            ('void print_int(int num) {\n')
            ('       printf("%d", num);\n')
            ('}\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'file creation' span_id:269))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:273) 
          (Token id:Id.Lit_Chars val:'\tgit apply patch1.patch\n' span_id:274)
        )
      }
    )
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'patch2 fails (retab)' span_id:281))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:285) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git apply patch2.patch\n'
            span_id: 286
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'patch2 applies with --ignore-whitespace' span_id:293))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:297) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit apply --ignore-whitespace patch2.patch\n'
            span_id: 298
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'patch2 reverse applies with --ignore-space-change'
            span_id: 305
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:309) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit apply -R --ignore-space-change patch2.patch\n'
            span_id: 310
          )
        )
      }
    )
    (C {(git)} {(config)} {(apply.ignorewhitespace)} {(change)})
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'patch2 applies (apply.ignorewhitespace = change)'
            span_id: 326
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:330) 
          (Token id:Id.Lit_Chars val:'\tgit apply patch2.patch &&\n' span_id:331) (Token id:Id.Lit_Chars val:'\ttest_cmp main.c.final main.c\n' span_id:332)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'patch3 fails (missing string at EOL)' span_id:339))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:343) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git apply patch3.patch\n'
            span_id: 344
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'patch4 fails (missing EOL at EOF)' span_id:351))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:355) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git apply patch4.patch\n'
            span_id: 356
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {
        (SQ 
          (Token
            id: Id.Lit_Chars
            val: 'patch5 fails (leading whitespace differences matter)'
            span_id: 363
          )
        )
      } 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:367) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git apply patch5.patch\n'
            span_id: 368
          )
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'re-create file (with --ignore-whitespace)' span_id:375))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:379) 
          (Token id:Id.Lit_Chars val:'\trm -f main.c &&\n' span_id:380) (Token id:Id.Lit_Chars val:'\tgit apply patch1.patch\n' span_id:381)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'patch5 fails (--no-ignore-whitespace)' span_id:388))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:392) 
          (Token
            id: Id.Lit_Chars
            val: '\ttest_must_fail git apply --no-ignore-whitespace patch5.patch\n'
            span_id: 393
          )
        )
      }
    )
    (C {(test_done)})
  ]
)