(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[12])
          op: Equal
          rhs: {(SQ <'test textconv caching'>)}
          spids: [12]
        )
      ]
      spids: [12]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(helper)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(SQ <EOF>)}
          here_end_span_id: 35
          stdin_parts: [
            ('#!/bin/sh\n')
            ('sed \'s/^/converted: /\' "$@" >helper.out\n')
            ('cat helper.out\n')
          ]
        )
      ]
    )
    (C {(chmod)} {(Lit_Other '+') (x)} {(helper)})
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\techo foo content 1 >foo.bin &&\n'> <'\techo bar content 1 >bar.bin &&\n'> 
          <'\tgit add . &&\n'> <'\tgit commit -m one &&\n'> <'\techo foo content 2 >foo.bin &&\n'> 
          <'\techo bar content 2 >bar.bin &&\n'> <'\tgit commit -a -m two &&\n'> <'\techo "*.bin diff=magic" >.gitattributes &&\n'> 
          <'\tgit config diff.magic.textconv ./helper &&\n'> <'\tgit config diff.magic.cachetextconv true\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 88
          stdin_parts: [
            ('diff --git a/bar.bin b/bar.bin\n')
            ('index fcf9166..28283d5 100644\n')
            ('--- a/bar.bin\n')
            ('+++ b/bar.bin\n')
            ('@@ -1 +1 @@\n')
            ('-converted: bar content 1\n')
            ('+converted: bar content 2\n')
            ('diff --git a/foo.bin b/foo.bin\n')
            ('index d5b9fe3..1345db2 100644\n')
            ('--- a/foo.bin\n')
            ('+++ b/foo.bin\n')
            ('@@ -1 +1 @@\n')
            ('-converted: foo content 1\n')
            ('+converted: foo content 2\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'first textconv works'>)} 
      {(SQ <'\n'> <'\tgit diff HEAD^ HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'cached textconv produces same output'>)} 
      {(SQ <'\n'> <'\tgit diff HEAD^ HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'cached textconv does not run helper'>)} 
      {
        (SQ <'\n'> <'\trm -f helper.out &&\n'> <'\tgit diff HEAD^ HEAD >actual &&\n'> 
          <'\ttest_cmp expect actual &&\n'> <'\t! test -r helper.out\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 156
          stdin_parts: [
            ('diff --git a/bar.bin b/bar.bin\n')
            ('index fcf9166..28283d5 100644\n')
            ('--- a/bar.bin\n')
            ('+++ b/bar.bin\n')
            ('@@ -1,2 +1,2 @@\n')
            (' converted: other\n')
            ('-converted: bar content 1\n')
            ('+converted: bar content 2\n')
            ('diff --git a/foo.bin b/foo.bin\n')
            ('index d5b9fe3..1345db2 100644\n')
            ('--- a/foo.bin\n')
            ('+++ b/foo.bin\n')
            ('@@ -1,2 +1,2 @@\n')
            (' converted: other\n')
            ('-converted: foo content 1\n')
            ('+converted: foo content 2\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'changing textconv invalidates cache'>)} 
      {
        (SQ <'\n'> <'\techo other >other &&\n'> 
          <'\tgit config diff.magic.textconv "./helper other" &&\n'> <'\tgit diff HEAD^ HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 196
          stdin_parts: [
            ('diff --git a/bar.bin b/bar.bin\n')
            ('index fcf9166..28283d5 100644\n')
            ('--- a/bar.bin\n')
            ('+++ b/bar.bin\n')
            ('@@ -1,2 +1,2 @@\n')
            (' converted: other\n')
            ('-converted: bar content 1\n')
            ('+converted: bar content 2\n')
            ('diff --git a/foo.bin b/foo.bin\n')
            ('index d5b9fe3..1345db2 100644\n')
            ('--- a/foo.bin\n')
            ('+++ b/foo.bin\n')
            ('@@ -1 +1 @@\n')
            ('-converted: foo content 1\n')
            ('+converted: foo content 2\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'switching diff driver produces correct results'>)} 
      {
        (SQ <'\n'> <'\tgit config diff.moremagic.textconv ./helper &&\n'> 
          <'\techo foo.bin diff=moremagic >>.gitattributes &&\n'> <'\tgit diff HEAD^ HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'log notes cache and still use cache for -p'>)} 
      {(SQ <'\n'> <'\tgit log --no-walk -p refs/notes/textconv/magic HEAD\n'>)}
    )
    (C {(test_done)})
  ]
)