(command.CommandList
  children: [
    (command.ShFunction
      name_tok: <test_terminal>
      name: test_terminal
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.If
              if_kw: <Id.KW_If if>
              arms: [
                (IfArm
                  keyword: <Id.KW_If if>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          negated: <Id.KW_Bang '!'>
                          children: [
                            (command.Simple
                              blame_tok: <test_declared_prereq>
                              more_env: []
                              words: [{<test_declared_prereq>} {<TTY>}]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          ops: []
                        )
                      ]
                    )
                  then_kw: <Id.KW_Then then>
                  action: [
                    (command.Simple
                      blame_tok: <echo>
                      more_env: []
                      words: [{<echo>} {(DQ <'test_terminal: need to declare TTY prerequisite'>)}]
                      redirects: [(Redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<4>})]
                      do_fork: T
                    )
                    (command.ControlFlow
                      keyword: <Id.ControlFlow_Return return>
                      arg_word: {<127>}
                    )
                  ]
                  spids: [21 30]
                )
              ]
              else_action: []
              fi_kw: <Id.KW_Fi fi>
              redirects: []
            )
            (command.Simple
              blame_tok: <perl>
              more_env: []
              words: [
                {<perl>}
                {(DQ ($ Id.VSub_DollarName TEST_DIRECTORY)) <'/test-terminal.perl'>}
                {(DQ ($ Id.VSub_At '@'))}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_lazy_prereq>
      more_env: []
      words: [
        {<test_lazy_prereq>}
        {<TTY>}
        {
          (SQ <'\n'> <'\ttest_have_prereq PERL &&\n'> <'\n'> 
            <'\t# Reading from the pty master seems to get stuck _sometimes_\n'> <'\t# on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.\n'> <'\t#\n'> <'\t# Reproduction recipe: run\n'> 
            <'\t#\n'> <'\t#\ti=0\n'> <'\t#\twhile ./test-terminal.perl echo hi $i\n'> <'\t#\tdo\n'> 
            <'\t#\t\t: $((i = $i + 1))\n'> <'\t#\tdone\n'> <'\t#\n'> <'\t# After 2000 iterations or so it hangs.\n'> 
            <'\t# https://rt.cpan.org/Ticket/Display.html?id=65692\n'> <'\t#\n'> <'\ttest "$(uname -s)" != Darwin &&\n'> <'\n'> 
            <'\tperl "$TEST_DIRECTORY"/test-terminal.perl \\\n'> <'\t\tsh -c "test -t 1 && test -t 2"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
  ]
)