(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'Test custom diff function name patterns'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <setup>)}
        {
          (SQ <'\n'> <'\t# a non-trivial custom pattern\n'> 
            <'\tgit config diff.custom1.funcname "!static\n'> <'!String\n'> <'[^ \t].*s.*" &&\n'> <'\n'> <'\t# a custom pattern which matches to end of line\n'> 
            <'\tgit config diff.custom2.funcname "......Beer\\$" &&\n'> <'\n'> <'\t# alternation in pattern\n'> <'\tgit config diff.custom3.funcname "Beer$" &&\n'> 
            <'\tgit config diff.custom3.xfuncname "^[ \t]*((public|static).*)$" &&\n'> <'\n'> <'\t# for regexp compilation tests\n'> <'\techo A >A.java &&\n'> <'\techo B >B.java\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'diffpatterns='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'diffpatterns='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'diffpatterns='> name:diffpatterns)
          op: assign_op.Equal
          rhs: 
            {
              (DQ <'\n'> <'\tada\n'> <'\tbibtex\n'> <'\tcpp\n'> <'\tcsharp\n'> <'\tcss\n'> <'\tfortran\n'> 
                <'\tfountain\n'> <'\thtml\n'> <'\tjava\n'> <'\tmatlab\n'> <'\tobjc\n'> <'\tpascal\n'> <'\tperl\n'> <'\tphp\n'> <'\tpython\n'> 
                <'\truby\n'> <'\ttex\n'> <'\tcustom1\n'> <'\tcustom2\n'> <'\tcustom3\n'>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [p]
      iterable: (for_iter.Words words:[{($ Id.VSub_DollarName diffpatterns)}])
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'builtin '> ($ Id.VSub_DollarName p) <' pattern compiles'>)}
                {
                  (SQ <'\n'> <'\t\techo "*.java diff=$p" >.gitattributes &&\n'> 
                    <'\t\ttest_expect_code 1 git diff --no-index \\\n'> <'\t\t\tA.java B.java 2>msg &&\n'> <'\t\ttest_i18ngrep ! fatal msg &&\n'> 
                    <'\t\ttest_i18ngrep ! error msg\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'builtin '> ($ Id.VSub_DollarName p) <' wordRegex pattern compiles'>)}
                {
                  (SQ <'\n'> <'\t\techo "*.java diff=$p" >.gitattributes &&\n'> 
                    <'\t\ttest_expect_code 1 git diff --no-index --word-diff \\\n'> <'\t\t\tA.java B.java 2>msg &&\n'> <'\t\ttest_i18ngrep ! fatal msg &&\n'> 
                    <'\t\ttest_i18ngrep ! error msg\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'last regexp must not be negated'>)}
        {
          (SQ <'\n'> <'\techo "*.java diff=java" >.gitattributes &&\n'> 
            <'\ttest_config diff.java.funcname "!static" &&\n'> <'\ttest_expect_code 128 git diff --no-index A.java B.java 2>msg &&\n'> 
            <'\ttest_i18ngrep ": Last expression must not be negated:" msg\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'setup hunk header tests'>)}
        {
          (SQ <'\n'> <'\tfor i in $diffpatterns\n'> <'\tdo\n'> <'\t\techo "$i-* diff=$i"\n'> 
            <'\tdone > .gitattributes &&\n'> <'\n'> <'\t# add all test files to the index\n'> <'\t(\n'> <'\t\tcd "$TEST_DIRECTORY"/t4018 &&\n'> 
            <'\t\tgit --git-dir="$TRASH_DIRECTORY/.git" add .\n'> <'\t) &&\n'> <'\n'> <'\t# place modified files in the worktree\n'> <'\tfor i in $(git ls-files)\n'> 
            <'\tdo\n'> <'\t\tsed -e "s/ChangeMe/IWasChanged/" <"$TEST_DIRECTORY/t4018/$i" >"$i" || return 1\n'> <'\tdone\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [i]
      iterable: 
        (for_iter.Words
          words: [
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [{<git>} {<ls-files>}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
          ]
        )
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          blame_tok: <grep>
                          more_env: []
                          words: [{<grep>} {<broken>} {(DQ ($ Id.VSub_DollarName i))}]
                          redirects: [
                            (Redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {<'/dev/null'>}
                            )
                            (Redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                          ]
                          do_fork: T
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.ShAssignment
                      left: <Id.Lit_VarLike 'result='>
                      pairs: [
                        (AssignPair
                          left: <Id.Lit_VarLike 'result='>
                          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result='> name:result)
                          op: assign_op.Equal
                          rhs: {<failure>}
                        )
                      ]
                      redirects: []
                    )
                  ]
                  spids: [187 204]
                )
              ]
              else_kw: <Id.KW_Else else>
              else_action: [
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'result='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'result='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'result='> name:result)
                      op: assign_op.Equal
                      rhs: {<success>}
                    )
                  ]
                  redirects: []
                )
              ]
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <test_expect_>
              more_env: []
              words: [
                {<test_expect_> ($ Id.VSub_DollarName result)}
                {(DQ <'hunk header: '> ($ Id.VSub_DollarName i))}
                {
                  (DQ <'\n'> <'\t\ttest_when_finished \'cat actual\' &&\t# for debugging only\n'> 
                    <'\t\tgit diff -U1 '> ($ Id.VSub_DollarName i) <' >actual &&\n'> <'\t\tgrep \'@@ .* @@.*RIGHT\' actual\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          right: <Id.KW_Done done>
        )
      redirects: []
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)