aboutsummaryrefslogtreecommitdiffstats
path: root/test/yarp
diff options
context:
space:
mode:
authorTim Morgan <tim@timmorgan.org>2023-09-15 11:26:13 -0500
committergit <svn-admin@ruby-lang.org>2023-09-15 21:47:27 +0000
commit101ac364a54b10a24e2351c2138b59a819665540 (patch)
treea483594a7b66a129182595606261c12879c069db /test/yarp
parent0996cf5593b212314221a7c2a72b8a52ece35e94 (diff)
downloadruby-101ac364a54b10a24e2351c2138b59a819665540.tar.gz
[ruby/yarp] Return Regexp options that match MRI for e, u, s, and n
https://github.com/ruby/yarp/commit/17dbf4ec46
Diffstat (limited to 'test/yarp')
-rw-r--r--test/yarp/regexp_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/yarp/regexp_test.rb b/test/yarp/regexp_test.rb
index c2f92e2bd1..865c70a2c8 100644
--- a/test/yarp/regexp_test.rb
+++ b/test/yarp/regexp_test.rb
@@ -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"))