summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-06-11 00:06:43 +0900
committerNobuyoshi Nakada <[email protected]>2022-04-12 20:24:14 +0900
commitcf2bbcfff2985c116552967c7c4522f4630f2d18 ()
tree5c1d9427852cdb2c6eff34917b7e4ca277c26790 /test/ruby
parent48ffa2804431ea24fa7a3b6f5470122b0128ba22 (diff)
Just free compiled pattern if no space is used
https://hackerone.com/reports/1220911
Notes: Merged: https://.com/ruby/ruby/pull/5793
-rw-r--r--test/ruby/test_regexp.rb9
1 files changed, 9 insertions, 0 deletions
@@ -1431,6 +1431,15 @@ class TestRegexp < Test::Unit::TestCase
assert_kind_of MatchData, /(?<x>a)(?<x>aa)\k<x>/.match("aaaab")
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)