(command.CommandList
  children: [
    (command.ShFunction
      name: check_count
      body: 
        (BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (C {<test>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_Backtick '`'>
                                child: 
                                  (C {<grep>} {<-c>} {(DQ ($ Id.VSub_Number '$2'))} 
                                    {(DQ ($ Id.VSub_Number '$1'))}
                                  )
                              )
                            )
                          } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ ($ Id.VSub_Number '$3'))}
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Did not find expected number ('> ($ Id.VSub_Number '$3') <') of \''> 
                          ($ Id.VSub_Number '$2') <'\' sections in '> ($ Id.VSub_Number '$1')
                        )
                      }
                    )
                    (C {<echo>} {(DQ )})
                    (C {<echo>} {(DQ <'Actual output below:'>)})
                    (C {<cat>} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [78 108]
                )
              ]
            )
          ]
        )
    )
    (C {<check_count>} {<script_test_5.stdout>} {(DQ <' .text '>)} {<1>})
    (C {<check_count>} {<script_test_5.stdout>} {(DQ <' .text.foo '>)} {<1>})
  ]
)