(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'test conversion filters on large files'>)}
          spids: [4]
        )
      ]
    )
    (C {<.>} {<./test-lib.sh>})
    (command.ShFunction
      name: set_attr
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (C {<test_when_finished>} {(SQ <'rm -f .gitattributes'>)})
                (command.Simple
                  words: [{<echo>} {(DQ <'* '> ($ Id.VSub_Star '$*'))}]
                  redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<.gitattributes>})]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check_input
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<git>} {<read-tree>} {<--empty>})
                (C {<git>} {<add>} {<small>} {<large>})
                (command.Simple
                  words: [{<git>} {<cat-file>} {<blob>} {<Id.Lit_Other ':'> <small>}]
                  redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<small.index>})]
                )
                (command.Pipeline
                  children: [
                    (C {<git>} {<cat-file>} {<blob>} {<Id.Lit_Other ':'> <large>})
                    (command.Simple
                      words: [{<head>} {<-n>} {<1>}]
                      redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<large.index>})]
                    )
                  ]
                  negated: F
                )
                (C {<test_cmp>} {<small.index>} {<large.index>})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: check_output
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DAmp Id.Op_DAmp]
              children: [
                (C {<rm>} {<-f>} {<small>} {<large>})
                (C {<git>} {<checkout>} {<small>} {<large>})
                (command.Simple
                  words: [{<head>} {<-n>} {<1>} {<large>}]
                  redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<large.head>})]
                )
                (C {<test_cmp>} {<small>} {<large.head>})
              ]
            )
          ]
        )
    )
    (C {<test_expect_success>} {(SQ <'setup input tests'>)} 
      {
        (SQ <'\n'> <'\tprintf "\\$Id: foo\\$\\\\r\\\\n" >small &&\n'> <'\tcat small small >large &&\n'> 
          <'\tgit config core.bigfilethreshold 20 &&\n'> <'\tgit config filter.test.clean "sed s/.*/CLEAN/"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'autocrlf=true converts on input'>)} 
      {(SQ <'\n'> <'\ttest_config core.autocrlf true &&\n'> <'\tcheck_input\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'eol=crlf converts on input'>)} 
      {(SQ <'\n'> <'\tset_attr eol=crlf &&\n'> <'\tcheck_input\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'ident converts on input'>)} 
      {(SQ <'\n'> <'\tset_attr ident &&\n'> <'\tcheck_input\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'user-defined filters convert on input'>)} 
      {(SQ <'\n'> <'\tset_attr filter=test &&\n'> <'\tcheck_input\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'setup output tests'>)} 
      {
        (SQ <'\n'> <'\techo "\\$Id\\$" >small &&\n'> <'\tcat small small >large &&\n'> 
          <'\tgit add small large &&\n'> <'\tgit config core.bigfilethreshold 7 &&\n'> <'\tgit config filter.test.smudge "sed s/.*/SMUDGE/"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(SQ <'autocrlf=true converts on output'>)} 
      {(SQ <'\n'> <'\ttest_config core.autocrlf true &&\n'> <'\tcheck_output\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'eol=crlf converts on output'>)} 
      {(SQ <'\n'> <'\tset_attr eol=crlf &&\n'> <'\tcheck_output\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'user-defined filters convert on output'>)} 
      {(SQ <'\n'> <'\tset_attr filter=test &&\n'> <'\tcheck_output\n'>)}
    )
    (C {<test_expect_success>} {(SQ <'ident converts on output'>)} 
      {
        (SQ <'\n'> <'\tset_attr ident &&\n'> <'\trm -f small large &&\n'> 
          <'\tgit checkout small large &&\n'> <'\tsed -n "s/Id: .*/Id: SHA/p" <small >small.clean &&\n'> <'\thead -n 1 large >large.head &&\n'> 
          <'\tsed -n "s/Id: .*/Id: SHA/p" <large.head >large.clean &&\n'> <'\ttest_cmp small.clean large.clean\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)