aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 13d7cc9d57..d657f1aae6 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -367,6 +367,7 @@ class TestSymbol < Test::Unit::TestCase
def test_match_method
assert_equal("bar", :"foobarbaz".match(/bar/).to_s)
+ assert_raise(TypeError) { :"".match(nil) }
o = Regexp.new('foo')
def o.match(x, y, z); x + y + z; end
@@ -420,6 +421,10 @@ class TestSymbol < Test::Unit::TestCase
assert_equal('backref', $&)
end
+ def test_match_p_nil
+ assert_raise(TypeError) { :''.match?(nil) }
+ end
+
def test_symbol_popped
assert_nothing_raised { eval('a = 1; :"#{ a }"; 1') }
end