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_rules.rb
    path of file: ./repos/markdownlint/test
    
    the code of the file until where you have to start completion: require_relative 'setup_tests'

class TestRules < Minitest::Test
  def get_expected_errors(lines)
    # Looks for lines tagged with {MD123} to signify that a rule is expected to
    # fire for this line. It also looks for lines tagged with {MD123:1} to
    # signify that a rule is expected 
    
  def get_expected_errors(lines)
    # Looks for lines tagged with {MD123} to signify that a rule is expected to
    # fire for this line. It also looks for lines tagged with {MD123:1} to
    # signify that a rule is expected to fire on another line (the line number
    # after the colon).
    expected_errors = {}
    re = /\{(MD\d+)(?::(\d+))?\}/
    lines.each_with_index do |line, num|
      m = re.match(line)
      while m
        expected_errors[m[1]] ||= []
        expected_line = if m[2]
                          m[2].to_i
                        else
                          num + 1 # 1 indexed lines
                        end
        expected_errors[m[1]] << expected_line
        m = re.match(line, m.end(0))
      end