(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[12])
          op: Equal
          rhs: {(SQ <'rewrite diff on binary file'>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.FuncDef
      name: make_file
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(printf)} {(DQ ('=') (Lit_Other '\\') (n))}]
              redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(file)})]
            )
            (command.ForEach
              iter_name: i
              iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)} {(10)}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.ForEach
                      iter_name: j
                      iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)}]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ForEach
                              iter_name: k
                              iter_words: [{(1)} {(2)} {(3)} {(4)} {(5)}]
                              do_arg_iter: F
                              body: 
                                (command.DoGroup
                                  children: [
                                    (C {(printf)} {(DQ ($ VSub_Number '$1') (Lit_Other '\\') (n))})
                                  ]
                                  spids: [127 139]
                                )
                              spids: [115 16777215]
                            )
                          ]
                          spids: [107 142]
                        )
                      spids: [87 16777215]
                    )
                  ]
                  spids: [79 145]
                )
              redirects: [(redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(file)})]
              spids: [57 16777215]
            )
          ]
          spids: [33]
        )
      spids: [29 32]
    )
    (C {(test_expect_success)} {(SQ <'create binary file with changes'>)} 
      {(SQ <'\n'> <'\tmake_file "\\\\0" &&\n'> <'\tgit add file &&\n'> <'\tmake_file "\\\\01"\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'vanilla diff is binary'>)} 
      {
        (SQ <'\n'> <'\tgit diff >diff &&\n'> <'\tgrep "Binary files a/file and b/file differ" diff\n'>)
      }
    )
    (C {(test_expect_success)} {(SQ <'rewrite diff is binary'>)} 
      {
        (SQ <'\n'> <'\tgit diff -B >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> 
          <'\tgrep "Binary files a/file and b/file differ" diff\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'rewrite diff can show binary patch'>)} 
      {
        (SQ <'\n'> <'\tgit diff -B --binary >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> 
          <'\tgrep "GIT binary patch" diff\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'rewrite diff --numstat shows binary changes'>)} 
      {
        (SQ <'\n'> <'\tgit diff -B --numstat --summary >diff &&\n'> <'\tgrep -e "-\t-\t" diff &&\n'> 
          <'\tgrep " rewrite file" diff\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff --stat counts binary rewrite as 0 lines'>)} 
      {
        (SQ <'\n'> <'\tgit diff -B --stat --summary >diff &&\n'> <'\tgrep "Bin" diff &&\n'> 
          <'\ttest_i18ngrep "0 insertions.*0 deletions" diff &&\n'> <'\tgrep " rewrite file" diff\n'>
        )
      }
    )
    (command.BraceGroup
      children: [
        (C {(echo)} {(DQ ('#!') ($ VSub_Name '$SHELL_PATH'))})
        (command.SimpleCommand
          words: [{(cat)}]
          redirects: [
            (redir.HereDoc
              op: <Redir_DLess '<<'>
              fd: 16777215
              here_begin: {(SQ <EOF>)}
              here_end_span_id: 256
              stdin_parts: [
                ('"$PERL_PATH" -e \'$/ = undef; $_ = <>; s/./ord($&)/ge; print $_\' < "$1"\n')
              ]
            )
          ]
        )
      ]
      redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(dump)})]
      spids: [237]
    )
    (C {(chmod)} {(Lit_Other '+') (x)} {(dump)})
    (C {(test_expect_success)} {(SQ <'setup textconv'>)} 
      {
        (SQ <'\n'> <'\techo file diff=foo >.gitattributes &&\n'> 
          <'\tgit config diff.foo.textconv "\\"$(pwd)\\""/dump\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'rewrite diff respects textconv'>)} 
      {
        (SQ <'\n'> <'\tgit diff -B >diff &&\n'> <'\tgrep "dissimilarity index" diff &&\n'> 
          <'\tgrep "^-61" diff &&\n'> <'\tgrep "^-0" diff\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)