From 478b4ef9de0de0d087f5c8d4d94b0b4af3753c6f Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Mon, 8 Apr 2024 12:31:33 -0400 Subject: [PATCH] Fix nil error with KNOWNBUGS.rb Previously, `make test-knownbugs` crashed with `NoMethodError` due to the failed regex match if there is a test case in KNOWNBUGS.rb. The note about 1.8 compatibility is probably bogus as we require a way more recent BASERUBY now. --- bootstraptest/runner.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb index 2135f14276..20f121cdf4 100755 --- a/bootstraptest/runner.rb +++ b/bootstraptest/runner.rb @@ -6,7 +6,6 @@ # Never use optparse in this file. # Never use test/unit in this file. # Never use Ruby extensions in this file. -# Maintain Ruby 1.8 compatibility for now $start_time = Time.now @@ -428,7 +427,7 @@ class Assertion < Struct.new(:src, :path, :lineno, :proc) def initialize(*args) super self.class.add self - @category = self.path.match(/test_(.+)\.rb/)[1] + @category = self.path[/\Atest_(.+)\.rb\z/, 1] end def call