(command.CommandList
  children: [
    (C {<Id.Lit_Colon ':'>} 
      {
        (braced_var_sub
          token: <Id.VSub_Name ATF_SH>
          suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonEquals arg_word:{(DQ <__ATF_SH__>)})
        )
      }
    )
    (command.ShFunction
      name: create_test_program
      body: 
        (BraceGroup
          children: [
            (command.Sentence
              child: (C {<local>} {<Id.Lit_VarLike 'output='> (DQ (${ Id.VSub_Number 1))})
              terminator: <Id.Op_Semi _>
            )
            (C {<shift>})
            (command.Simple
              words: [{<echo>} {(DQ <'#! '> (${ Id.VSub_Name ATF_SH) <' '> (${ Id.VSub_Star '*'))}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ (${ Id.VSub_Name output))}
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_DGreat '>>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ (${ Id.VSub_Name output))}
                )
              ]
              do_fork: T
            )
            (C {<chmod>} {<Id.Lit_Other '+'> <x>} {(DQ (${ Id.VSub_Name output))})
          ]
        )
    )
    (C {<atf_test_case>} {<no_args>})
    (command.ShFunction
      name: no_args_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<experr>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 171
                      stdin_parts: [
                        <'atf-sh: ERROR: No test program provided\n'>
                        <'atf-sh: See atf-sh(1) for usage details.\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <1>} {<-o>} {<ignore>} {<-e>} 
              {<file> <Id.Lit_Colon ':'> <experr>} {(DQ (${ Id.VSub_Name ATF_SH))}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<missing_script>})
    (command.ShFunction
      name: missing_script_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<experr>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 221
                      stdin_parts: [
                        <'atf-sh: ERROR: The test program \'non-existent\' does not exist\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <1>} {<-o>} {<ignore>} {<-e>} 
              {<file> <Id.Lit_Colon ':'> <experr>} {(DQ (${ Id.VSub_Name ATF_SH))} {<non-existent>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<arguments>})
    (command.ShFunction
      name: arguments_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<create_test_program>} {<tp>}]
              redirects: [
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 293
                      stdin_parts: [
                        <'main() {\n'>
                        <'    echo '>
                        <Id.Right_DoubleQuote '"'>
                        <'>>>'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{0}<<<'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                        <'    while test '>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{#} -gt 0; do\n'>
                        <'        echo '>
                        <Id.Right_DoubleQuote '"'>
                        <'>>>'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{1}<<<'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                        <'        shift\n'>
                        <'    done\n'>
                        <'    true\n'>
                        <'}\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expout>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 308
                      stdin_parts: [<'>>>./tp<<<\n'> <'>>> a b <<<\n'> <'>>>foo<<<\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<file> <Id.Lit_Colon ':'> <expout>} {<-e>} {<empty>} {<'./tp'>} {(SQ <' a b '>)} {<foo>}
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expout>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 350
                      stdin_parts: [<'>>>tp<<<\n'> <'>>> hello bye <<<\n'> <'>>>foo bar<<<\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<file> <Id.Lit_Colon ':'> <expout>} {<-e>} {<empty>} {(DQ (${ Id.VSub_Name ATF_SH))} {<tp>} {(SQ <' hello bye '>)} {(SQ <'foo bar'>)}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<custom_shell__command_line>})
    (command.ShFunction
      name: custom_shell__command_line_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expout>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 413
                      stdin_parts: [<'This is the custom shell\n'> <'This is the test program\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<custom-shell>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 437
                      stdin_parts: [
                        <'#! /bin/sh\n'>
                        <'echo '>
                        <Id.Right_DoubleQuote '"'>
                        <'This is the custom shell'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                        <'exec /bin/sh '>
                        <Id.Right_DoubleQuote '"'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{@}'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<chmod>} {<Id.Lit_Other '+'> <x>} {<custom-shell>})
            (command.Pipeline
              children: [
                (C {<echo>} {(SQ <'main() { echo "This is the test program"; }'>)})
                (C {<create_test_program>} {<tp>})
              ]
              negated: F
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<file> <Id.Lit_Colon ':'> <expout>} {<-e>} {<empty>} {(DQ (${ Id.VSub_Name ATF_SH))} {<-s>} {<'./custom-shell'>} {<tp>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<custom_shell__shebang>})
    (command.ShFunction
      name: custom_shell__shebang_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expout>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 516
                      stdin_parts: [<'This is the custom shell\n'> <'This is the test program\n'>]
                    )
                )
              ]
              do_fork: T
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<custom-shell>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 540
                      stdin_parts: [
                        <'#! /bin/sh\n'>
                        <'echo '>
                        <Id.Right_DoubleQuote '"'>
                        <'This is the custom shell'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                        <'exec /bin/sh '>
                        <Id.Right_DoubleQuote '"'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{@}'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<chmod>} {<Id.Lit_Other '+'> <x>} {<custom-shell>})
            (command.Pipeline
              children: [
                (C {<echo>} {(SQ <'main() { echo "This is the test program"; }'>)})
                (C {<create_test_program>} {<tp>} 
                  {
                    (DQ <-s> (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<pwd>})) 
                      <'/custom-shell'>
                    )
                  }
                )
              ]
              negated: F
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<file> <Id.Lit_Colon ':'> <expout>} {<-e>} {<empty>} {<'./tp'>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<set_e>})
    (command.ShFunction
      name: set_e_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Simple test to validate that atf-sh works even when'>)} 
              {(DQ <'set -e is enabled'>)}
            )
          ]
        )
    )
    (command.ShFunction
      name: set_e_body
      body: 
        (BraceGroup
          children: [
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {<custom-shell>}
                )
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 649
                      stdin_parts: [
                        <'#! /bin/sh\n'>
                        <'exec /bin/sh -e '>
                        <Id.Right_DoubleQuote '"'>
                        (word_part.EscapedLiteral
                          token: <Id.Lit_EscapedChar '\\$'>
                        )
                        <'{@}'>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<chmod>} {<Id.Lit_Other '+'> <x>} {<custom-shell>})
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<tp>})
                (redir
                  op: <Id.Redir_DLess '<<'>
                  loc: (redir_loc.Fd fd:0)
                  arg: 
                    (redir_param.MultiLine
                      here_begin: {<EOF>}
                      here_end_span_id: 680
                      stdin_parts: [
                        <'atf_test_case helper\n'>
                        <'helper_body() {\n'>
                        <'    atf_skip '>
                        <Id.Right_DoubleQuote '"'>
                        <reached>
                        <Id.Right_DoubleQuote '"'>
                        <'\n'>
                        <'}\n'>
                        <'atf_init_test_cases() {\n'>
                        <'    atf_add_test_case helper\n'>
                        <'}\n'>
                      ]
                    )
                )
              ]
              do_fork: T
            )
            (C {<atf_check>} {<-s>} {<eq> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<match> <Id.Lit_Colon ':'> <skipped.> <Id.Lit_Star '*'> <reached>} {(DQ (${ Id.VSub_Name ATF_SH))} {<-s>} {<'./custom-shell'>} {<tp>} {<helper>}
            )
          ]
        )
    )
    (command.ShFunction
      name: atf_init_test_cases
      body: 
        (BraceGroup
          children: [
            (C {<atf_add_test_case>} {<no_args>})
            (C {<atf_add_test_case>} {<missing_script>})
            (C {<atf_add_test_case>} {<arguments>})
            (C {<atf_add_test_case>} {<custom_shell__command_line>})
            (C {<atf_add_test_case>} {<custom_shell__shebang>})
            (C {<atf_add_test_case>} {<set_e>})
          ]
        )
    )
  ]
)