merge cf2bbcfff2 partially.

Add the relevant test code for 73f45e5e96.
This commit is contained in:
nagachika 2022-05-01 16:36:46 +09:00
parent 322dfc9acc
commit 76b52b42a3
2 changed files with 12 additions and 3 deletions

View file

@ -1396,6 +1396,15 @@ class TestRegexp < Test::Unit::TestCase
end
end
def test_invalid_group
assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
begin;
assert_raise_with_message(RegexpError, /invalid conditional pattern/) do
Regexp.new("((?(1)x|x|)x)+")
end
end;
end
# This assertion is for porting x2() tests in testpy.py of Onigmo.
def assert_match_at(re, str, positions, msg = nil)
re = Regexp.new(re) unless re.is_a?(Regexp)

View file

@ -11,11 +11,11 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 2
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
#define RUBY_PATCHLEVEL 20
#define RUBY_PATCHLEVEL 21
#define RUBY_RELEASE_YEAR 2022
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 16
#define RUBY_RELEASE_MONTH 5
#define RUBY_RELEASE_DAY 1
#include "ruby/version.h"