summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-16 09:25:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-16 09:25:08 +0000
commit527fa610870bd7823560ba7fda8e72e21fc42d7e (patch)
tree9279606c602141636fbb4ac6e371f4de789c0141 /test/ruby
parent135a171ce11dc56d037bfc9c5c50b006042621c4 (diff)
numeric.c: fix segfault
* numeric.c (compare_with_zero): fix variable name, rb_cmperr requires VALUEs but not an ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_numeric.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index 89e11d0..5c55539 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -348,4 +348,14 @@ class TestNumeric < Test::Unit::TestCase
assert_not_operator(1, :eql?, 1.0)
assert_not_operator(1, :eql?, 2)
end
+
+ def test_coerced_remainder
+ assert_separately([], <<-'end;')
+ x = Class.new do
+ def coerce(a) [self, a]; end
+ def %(a) self; end
+ end.new
+ assert_raise(ArgumentError) {1.remainder(x)}
+ end;
+ end
end