You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_parser.rb
    path of file: ./repos/jruby/test/mri/psych
    
    the code of the file until where you have to start completion: # coding: utf-8
# frozen_string_literal: true

require_relative 'helper'

module Psych
  class TestParser < TestCase
    class EventCatcher < Handler
      attr_accessor :parser
      attr_reader :calls, :marks
      def initialize
        @parser = nil
        @calls  = []
        @marks  = []
      end

      (Handler.instance_methods(true) -
       Object.instance_methods).each do |m|
        class_eval <<~RUBY, __FILE__, __LINE__ + 1
          def #{m} *args
            super
            @marks << @parser.mark if @parser
            @calls << [:#{m}, args]
          end
        RUBY
      end
    end

    def setup
      super
      @handler        = EventCatcher.new
      @parser         = Psych::Parser.new @handler
      @handler.parser = @parser
    end

    def test_ast_roundtrip
      parser = Psych.parser
      parser.parse('null')
      ast = parser.han
    
    def test_line_numbers
      assert_equal 0, @parser.mark.line
      pend "Failing on JRuby" if RUBY_PLATFORM =~ /java/

      @parser.parse "---\n- hello\n- world"
      line_calls = @handler.marks.map(&:line).zip(@handler.calls.map(&:first))
      assert_equal [
                    [0, :event_location],
                    [0, :start_stream],
                    [0, :event_location],
                    [0, :start_document],
                    [1, :event_location],
                    [1, :start_sequence],
                    [2, :event_location],
                    [2, :scalar],
                    [3, :event_location],
                    [3, :scalar],
                    [3, :event_location],
                    [3, :end_sequence],
                    [3, :event_location],
                    [3, :end_document],
                    [3, :event_location],
                    [3, :end_stream]], line_calls

      assert_equal 3, @parser.mark.line
    end