summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-12 09:29:35 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-12 09:29:35 +0000
commitc0c733791c33579a1bdf12a16a809b5c07b6a7b4 (patch)
treefd2b90f5e8ab13b3fcfd70e3982decd89759f457 /test/ruby/test_regexp.rb
parent3aeef6bcf0a43a86a621da73c90ce3c8c4e646e6 (diff)
* test/ruby/test_regexp.rb: Add test cases for `$KCODE` and `$=` warning
[Misc #11770][ruby-dev:49398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb10
1 files changed, 10 insertions, 0 deletions
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 = $~