mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE
[ruby-core:35054] * test/ruby/test_regexp.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
71bf292ba1
commit
89ef6628eb
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Thu Feb 3 07:16:11 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* re.c (Init_Regexp): added a constant for ARG_ENCODING_NONE
|
||||
[ruby-core:35054]
|
||||
|
||||
* test/ruby/test_regexp.rb: corresponding test.
|
||||
|
||||
Thu Feb 3 07:02:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
|
||||
|
|
1
re.c
1
re.c
|
@ -3562,6 +3562,7 @@ Init_Regexp(void)
|
|||
rb_define_const(rb_cRegexp, "EXTENDED", INT2FIX(ONIG_OPTION_EXTEND));
|
||||
rb_define_const(rb_cRegexp, "MULTILINE", INT2FIX(ONIG_OPTION_MULTILINE));
|
||||
rb_define_const(rb_cRegexp, "FIXEDENCODING", INT2FIX(ARG_ENCODING_FIXED));
|
||||
rb_define_const(rb_cRegexp, "NOENCODING", INT2FIX(ARG_ENCODING_NONE));
|
||||
|
||||
rb_global_variable(®_cache);
|
||||
|
||||
|
|
|
@ -11,6 +11,12 @@ class TestRegexp < Test::Unit::TestCase
|
|||
$VERBOSE = @verbose
|
||||
end
|
||||
|
||||
def test_has_NOENCODING
|
||||
assert Regexp::NOENCODING
|
||||
re = //n
|
||||
assert_equal Regexp::NOENCODING, re.options
|
||||
end
|
||||
|
||||
def test_ruby_dev_999
|
||||
assert_match(/(?<=a).*b/, "aab")
|
||||
assert_match(/(?<=\u3042).*b/, "\u3042ab")
|
||||
|
|
Loading…
Add table
Reference in a new issue