(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 <'git mailinfo and git mailsplit test'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'DATA='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'DATA='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'DATA='> name:DATA)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName TEST_DIRECTORY) <'/t5100'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'split sample box'>)}
        {
          (SQ <'git mailsplit -o. "$DATA/sample.mbox" >last &&\n'> <'\tlast=$(cat last) &&\n'> 
            <'\techo total is $last &&\n'> <'\ttest $(cat last) = 18'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      name_tok: <check_mailinfo>
      name: check_mailinfo
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'mail='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'mail='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'mail='> name:mail)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
                (AssignPair
                  left: <Id.Lit_VarLike 'opt='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'opt='> name:opt)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'mo='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'mo='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'mo='> name:mo)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_DollarName mail) ($ Id.VSub_DollarName opt))}
                )
              ]
              redirects: []
            )
            (command.AndOr
              children: [
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [
                    {<git>}
                    {<mailinfo>}
                    {<-u>}
                    {($ Id.VSub_DollarName opt)}
                    {(DQ <msg> ($ Id.VSub_DollarName mo))}
                    {(DQ <patch> ($ Id.VSub_DollarName mo))}
                  ]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Less '<'>
                      loc: (redir_loc.Fd fd:0)
                      arg: {(DQ ($ Id.VSub_DollarName mail))}
                    )
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ <info> ($ Id.VSub_DollarName mo))}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ ($ Id.VSub_DollarName DATA) <'/msg'> ($ Id.VSub_DollarName mo))}
                    {(DQ <msg> ($ Id.VSub_DollarName mo))}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ ($ Id.VSub_DollarName DATA) <'/patch'> ($ Id.VSub_DollarName mo))}
                    {(DQ <patch> ($ Id.VSub_DollarName mo))}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ ($ Id.VSub_DollarName DATA) <'/info'> ($ Id.VSub_DollarName mo))}
                    {(DQ <info> ($ Id.VSub_DollarName mo))}
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [mail]
      iterable: (for_iter.Words words:[{<00> <Id.Lit_Star '*'>}])
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'mailinfo '> ($ Id.VSub_DollarName mail))}
                {
                  (SQ <'\n'> <'\t\tcheck_mailinfo "$mail" "" &&\n'> 
                    <'\t\tif test -f "$DATA/msg$mail--scissors"\n'> <'\t\tthen\n'> <'\t\t\tcheck_mailinfo "$mail" --scissors\n'> <'\t\tfi &&\n'> 
                    <'\t\tif test -f "$DATA/msg$mail--no-inbody-headers"\n'> <'\t\tthen\n'> <'\t\t\tcheck_mailinfo "$mail" --no-inbody-headers\n'> <'\t\tfi &&\n'> 
                    <'\t\tif test -f "$DATA/msg$mail--message-id"\n'> <'\t\tthen\n'> <'\t\t\tcheck_mailinfo "$mail" --message-id\n'> <'\t\tfi\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 <'split box with rfc2047 samples'>)}
        {
          (SQ <'mkdir rfc2047 &&\n'> <'\tgit mailsplit -orfc2047 "$DATA/rfc2047-samples.mbox" \\\n'> 
            <'\t  >rfc2047/last &&\n'> <'\tlast=$(cat rfc2047/last) &&\n'> <'\techo total is $last &&\n'> <'\ttest $(cat rfc2047/last) = 11'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ForEach
      keyword: <Id.KW_For for>
      iter_names: [mail]
      iterable: (for_iter.Words words:[{<'rfc2047/00'> <Id.Lit_Star '*'>}])
      body: 
        (command.DoGroup
          left: <Id.KW_Do do>
          children: [
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ <'mailinfo '> ($ Id.VSub_DollarName mail))}
                {
                  (SQ <'\n'> 
                    <'\t\tgit mailinfo -u "$mail-msg" "$mail-patch" <"$mail" >"$mail-info" &&\n'> <'\t\techo msg &&\n'> <'\t\ttest_cmp "$DATA/empty" "$mail-msg" &&\n'> <'\t\techo patch &&\n'> 
                    <'\t\ttest_cmp "$DATA/empty" "$mail-patch" &&\n'> <'\t\techo info &&\n'> <'\t\ttest_cmp "$DATA/rfc2047-info-$(basename $mail)" "$mail-info"\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 <'respect NULs'>)}
        {
          (SQ <'\n'> <'\n'> <'\tgit mailsplit -d3 -o. "$DATA/nul-plain" &&\n'> 
            <'\ttest_cmp "$DATA/nul-plain" 001 &&\n'> <'\t(cat 001 | git mailinfo msg patch) &&\n'> <'\ttest_line_count = 4 patch\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'Preserve NULs out of MIME encoded message'>)}
        {
          (SQ <'\n'> <'\n'> <'\tgit mailsplit -d5 -o. "$DATA/nul-b64.in" &&\n'> 
            <'\ttest_cmp "$DATA/nul-b64.in" 00001 &&\n'> <'\tgit mailinfo msg patch <00001 &&\n'> <'\ttest_cmp "$DATA/nul-b64.expect" patch\n'> <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo on from header without name works'>)}
        {
          (SQ <'\n'> <'\n'> <'\tmkdir info-from &&\n'> 
            <'\tgit mailsplit -oinfo-from "$DATA/info-from.in" &&\n'> <'\ttest_cmp "$DATA/info-from.in" info-from/0001 &&\n'> 
            <'\tgit mailinfo info-from/msg info-from/patch \\\n'> <'\t  <info-from/0001 >info-from/out &&\n'> <'\ttest_cmp "$DATA/info-from.expect" info-from/out\n'> 
            <'\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo finds headers after embedded From line'>)}
        {
          (SQ <'\n'> <'\tmkdir embed-from &&\n'> 
            <'\tgit mailsplit -oembed-from "$DATA/embed-from.in" &&\n'> <'\ttest_cmp "$DATA/embed-from.in" embed-from/0001 &&\n'> 
            <'\tgit mailinfo embed-from/msg embed-from/patch \\\n'> <'\t  <embed-from/0001 >embed-from/out &&\n'> 
            <'\ttest_cmp "$DATA/embed-from.expect" embed-from/out\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo on message with quoted >From'>)}
        {
          (SQ <'\n'> <'\tmkdir quoted-from &&\n'> 
            <'\tgit mailsplit -oquoted-from "$DATA/quoted-from.in" &&\n'> <'\ttest_cmp "$DATA/quoted-from.in" quoted-from/0001 &&\n'> 
            <'\tgit mailinfo quoted-from/msg quoted-from/patch \\\n'> <'\t  <quoted-from/0001 >quoted-from/out &&\n'> 
            <'\ttest_cmp "$DATA/quoted-from.expect" quoted-from/msg\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo unescapes with --mboxrd'>)}
        {
          (SQ <'\n'> <'\tmkdir mboxrd &&\n'> <'\tgit mailsplit -omboxrd --mboxrd \\\n'> 
            <'\t\t"$DATA/sample.mboxrd" >last &&\n'> <'\ttest x"$(cat last)" = x2 &&\n'> <'\tfor i in 0001 0002\n'> <'\tdo\n'> 
            <'\t\tgit mailinfo mboxrd/msg mboxrd/patch \\\n'> <'\t\t  <mboxrd/$i >mboxrd/out &&\n'> <'\t\ttest_cmp "$DATA/${i}mboxrd" mboxrd/msg\n'> <'\tdone &&\n'> 
            <'\tsp=" " &&\n'> <'\techo "From " >expect &&\n'> <'\techo "From " >>expect &&\n'> <'\techo >> expect &&\n'> 
            <'\tcat >sp <<-INPUT_END &&\n'> <'\tFrom mboxrd Mon Sep 17 00:00:00 2001\n'> <'\tFrom: trailing spacer <sp@example.com>\n'> 
            <'\tSubject: [PATCH] a commit with trailing space\n'> <'\n'> <'\tFrom$sp\n'> <'\t>From$sp\n'> <'\n'> <'\tINPUT_END\n'> <'\n'> 
            <'\tgit mailsplit -f2 -omboxrd --mboxrd <sp >last &&\n'> <'\ttest x"$(cat last)" = x1 &&\n'> <'\tgit mailinfo mboxrd/msg mboxrd/patch <mboxrd/0003 &&\n'> 
            <'\ttest_cmp expect mboxrd/msg\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo handles rfc2822 quoted-string'>)}
        {
          (SQ <'\n'> <'\tmkdir quoted-string &&\n'> 
            <'\tgit mailinfo /dev/null /dev/null <"$DATA/quoted-string.in" \\\n'> <'\t\t>quoted-string/info &&\n'> <'\ttest_cmp "$DATA/quoted-string.expect" quoted-string/info\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'mailinfo handles rfc2822 comment'>)}
        {
          (SQ <'\n'> <'\tmkdir comment &&\n'> 
            <'\tgit mailinfo /dev/null /dev/null <"$DATA/comment.in" \\\n'> <'\t\t>comment/info &&\n'> <'\ttest_cmp "$DATA/comment.expect" comment/info\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)