diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 22:15:23 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 22:15:23 +0000 |
commit | 3df94d7b5d7129d50443b77f869835b958423fd5 (patch) | |
tree | 0f4f4653b02cda56cc7f5b6b73850ca9d4a591a4 /test/ruby/test_regexp.rb | |
parent | c34e9f23aa2b6909e92623710e91cd99eaff2dc3 (diff) | |
download | ruby-3df94d7b5d7129d50443b77f869835b958423fd5.tar.gz |
* re.c (reg_operand): Simplify and reuse error handling [Bug #7539]
* test/ruby/test_regexp.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r-- | test/ruby/test_regexp.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index e9c866a9ca..308b30ae9c 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -929,4 +929,11 @@ class TestRegexp < Test::Unit::TestCase # use Regexp.new instead of literal to ignore a parser warning. check(Regexp.new('[0-1-\\s]'), [' ', '-'], ['2', 'a'], bug6853) end + + def test_error_message_on_failed_conversion + bug7539 = '[ruby-core:50733]' + assert_equal false, /x/=== 42 + err = assert_raise(TypeError){ Regexp.quote(42) } + assert_equal 'no implicit conversion of Fixnum into String', err.message, bug7539 + end end |