diff options
author | Tim Morgan <tim@timmorgan.org> | 2023-09-15 11:26:13 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-15 21:47:27 +0000 |
commit | 101ac364a54b10a24e2351c2138b59a819665540 (patch) | |
tree | a483594a7b66a129182595606261c12879c069db /test/yarp | |
parent | 0996cf5593b212314221a7c2a72b8a52ece35e94 (diff) | |
download | ruby-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.rb | 14 |
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")) |