summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--re.c1
-rw-r--r--test/ruby/test_regexp.rb6
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7dd1cfe9f1..64a9e7617f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/re.c b/re.c
index be815f527f..8f2694b817 100644
--- a/re.c
+++ b/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(&reg_cache);
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index b0a9eb2c16..1bc2d0a79f 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -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")