summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_regexp.rb10
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cac23e0d5f..2e683c73c9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Dec 12 17:59:07 2015 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+
+ * test/ruby/test_regexp.rb: Add test cases for `$KCODE` and `$=` warning
+ [Misc #11770][ruby-dev:49398]
+
Sat Dec 12 17:11:57 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
* doc/NEWS-0.2.2: add description about incompatible change in Hash
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index a3fdd597389..8e01c055973 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -537,6 +537,16 @@ class TestRegexp < Test::Unit::TestCase
assert_nothing_raised { $= = nil }
end
+ def test_KCODE_warning
+ assert_warning(/variable \$KCODE is no longer effective; ignored/) { $KCODE = nil }
+ assert_warning(/variable \$KCODE is no longer effective/) { $KCODE = nil }
+ end
+
+ def test_ignorecase_warning
+ assert_warning(/variable \$= is no longer effective; ignored/) { $= = nil }
+ assert_warning(/variable \$= is no longer effective/) { $= }
+ end
+
def test_match_setter
/foo/ =~ "foo"
m = $~