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_flags.rb
    path of file: ./repos/truffleruby/test/mri/tests/mkmf
    
    the code of the file until where you have to start completion: # frozen_string_literal: false
require_relative 'base'

class TestMkmfFlags < TestMkmf
  def test_valid_warnflags
    val = $extmk
    warnflags = $warnflags
    makefile = mkmf do
      $extmk = false
      self.class::CONFIG['warnflags'] = %w"-Wextra
      -Wno-unused-parameter -Wno-parentheses -Wno-long-long
      -Wno-missing-field-initializers -Werror=pointer-arith
      -Werror=write-strings -Werror=declaration-after-statement
      -Werror=shorten-64-to-32
      -Werror-implicit-function-declaration
      ".join(' ')
      self.cl
    
  def test_valid_warnflags
    val = $extmk
    warnflags = $warnflags
    makefile = mkmf do
      $extmk = false
      self.class::CONFIG['warnflags'] = %w"-Wextra
      -Wno-unused-parameter -Wno-parentheses -Wno-long-long
      -Wno-missing-field-initializers -Werror=pointer-arith
      -Werror=write-strings -Werror=declaration-after-statement
      -Werror=shorten-64-to-32
      -Werror-implicit-function-declaration
      ".join(' ')
      self.class::CONFIG['GCC'] = 'yes'
      init_mkmf(self.class::CONFIG)
      configuration '.'
    end
    generated_flags = makefile.grep(/warnflags/).first[/^warnflags = (.*)$/, 1].split

    assert_equal %w"
    -Wextra -Wno-unused-parameter -Wno-parentheses
    -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith
    -Wwrite-strings -Wdeclaration-after-statement
    -Wshorten-64-to-32 -Werror-implicit-function-declaration
    ", generated_flags

  ensure
    $warnflags = warnflags
    $extmk = val
  end