(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:'test textconv caching' span_id:6))}
          spids: [4]
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:16) fd:-1 arg_word:{(helper)})
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:19)
          fd: -1
          here_begin: {(SQ (Token id:Id.Lit_Chars val:EOF span_id:21))}
          here_end_span_id: 27
          stdin_parts: [
            ('#!/bin/sh\n')
            ('sed \'s/^/converted: /\' "$@" >helper.out\n')
            ('cat helper.out\n')
          ]
        )
      ]
    )
    (C {(chmod)} {(Id.Lit_Other '+') (x)} {(helper)})
    (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:39))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:43) 
          (Token id:Id.Lit_Chars val:'\techo foo content 1 >foo.bin &&\n' span_id:44) (Token id:Id.Lit_Chars val:'\techo bar content 1 >bar.bin &&\n' span_id:45) 
          (Token id:Id.Lit_Chars val:'\tgit add . &&\n' span_id:46) (Token id:Id.Lit_Chars val:'\tgit commit -m one &&\n' span_id:47) 
          (Token id:Id.Lit_Chars val:'\techo foo content 2 >foo.bin &&\n' span_id:48) (Token id:Id.Lit_Chars val:'\techo bar content 2 >bar.bin &&\n' span_id:49) 
          (Token id:Id.Lit_Chars val:'\tgit commit -a -m two &&\n' span_id:50) (Token id:Id.Lit_Chars val:'\techo "*.bin diff=magic" >.gitattributes &&\n' span_id:51) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config diff.magic.textconv ./helper &&\n'
            span_id: 52
          ) (Token id:Id.Lit_Chars val:'\tgit config diff.magic.cachetextconv true\n' span_id:53)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:(Token id:Id.Redir_Great val:'>' span_id:59) fd:-1 arg_word:{(expect)})
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:62)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 80
          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 (Token id:Id.Lit_Chars val:'first textconv works' span_id:85))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:89) 
          (Token id:Id.Lit_Chars val:'\tgit diff HEAD^ HEAD >actual &&\n' span_id:90) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:91)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'cached textconv produces same output' span_id:98))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:102) 
          (Token id:Id.Lit_Chars val:'\tgit diff HEAD^ HEAD >actual &&\n' span_id:103) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:104)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'cached textconv does not run helper' span_id:111))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:115) 
          (Token id:Id.Lit_Chars val:'\trm -f helper.out &&\n' span_id:116) (Token id:Id.Lit_Chars val:'\tgit diff HEAD^ HEAD >actual &&\n' span_id:117) 
          (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:118) (Token id:Id.Lit_Chars val:'\t! test -r helper.out\n' span_id:119)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:125)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:128)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 148
          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 (Token id:Id.Lit_Chars val:'changing textconv invalidates cache' span_id:152))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:156) 
          (Token id:Id.Lit_Chars val:'\techo other >other &&\n' span_id:157) (Token id:Id.Lit_Chars val:'\tgit config diff.magic.textconv "./helper other" &&\n' span_id:158) 
          (Token id:Id.Lit_Chars val:'\tgit diff HEAD^ HEAD >actual &&\n' span_id:159) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:160)
        )
      }
    )
    (command.Simple
      words: [{(cat)}]
      redirects: [
        (redir.Redir
          op: (Token id:Id.Redir_Great val:'>' span_id:166)
          fd: -1
          arg_word: {(expect)}
        )
        (redir.HereDoc
          op: (Token id:Id.Redir_DLess val:'<<' span_id:169)
          fd: -1
          here_begin: {(EOF)}
          here_end_span_id: 188
          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 (Token id:Id.Lit_Chars val:'switching diff driver produces correct results' span_id:192))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:196) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit config diff.moremagic.textconv ./helper &&\n'
            span_id: 197
          ) (Token id:Id.Lit_Chars val:'\techo foo.bin diff=moremagic >>.gitattributes &&\n' span_id:198) 
          (Token id:Id.Lit_Chars val:'\tgit diff HEAD^ HEAD >actual &&\n' span_id:199) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:200)
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ (Token id:Id.Lit_Chars val:'log notes cache and still use cache for -p' span_id:219))} 
      {
        (SQ (Token id:Id.Lit_Chars val:'\n' span_id:223) 
          (Token
            id: Id.Lit_Chars
            val: '\tgit log --no-walk -p refs/notes/textconv/magic HEAD\n'
            span_id: 224
          )
        )
      }
    )
    (C {(test_done)})
  ]
)