[ruby/yarp] Return Regexp options that match MRI for e, u, s, and n

17dbf4ec46
This commit is contained in:
Tim Morgan 2023-09-15 11:26:13 -05:00 committed by git
parent 0996cf5593
commit 101ac364a5
2 changed files with 28 additions and 8 deletions

View file

@ -208,6 +208,20 @@ module YARP
assert_equal(Regexp::MULTILINE, options("m"))
end
def test_flag_fixedencoding
assert_equal(Regexp::FIXEDENCODING, options("e"))
assert_equal(Regexp::FIXEDENCODING, options("u"))
assert_equal(Regexp::FIXEDENCODING, options("s"))
end
def test_flag_noencoding
assert_equal(Regexp::NOENCODING, options("n"))
end
def test_flag_once
assert_equal(0, options("o"))
end
def test_flag_combined
value = Regexp::IGNORECASE | Regexp::MULTILINE | Regexp::EXTENDED
assert_equal(value, options("mix"))