[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>
I'll try to be brief so we can discuss all this. tl;dr: RubySpec is
19 messages
2015/01/05
[#67353] Re: Future of test suites for Ruby
— Tanaka Akira <akr@...>
2015/01/05
2015-01-06 7:18 GMT+09:00 Charles Oliver Nutter <[email protected]>:
[#67444] [ruby-trunk - Feature #10718] [Open] IO#close should not raise IOError on closed IO objects. — akr@...
Issue #10718 has been reported by Akira Tanaka.
3 messages
2015/01/09
[#67689] Keyword Arguments — Anthony Crumley <anthony.crumley@...>
Please forgive my ignorance as I am new to MRI development and am still
5 messages
2015/01/20
[#67733] [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5 — normalperson@...
Issue #10761 has been updated by Eric Wong.
4 messages
2015/01/21
[#67736] Re: [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5
— Eric Wong <normalperson@...>
2015/01/22
[email protected] wrote:
[#67772] Preventing Redundant Email Messages — Jeremy Evans <code@...>
For a long time, I've wondered why I sometimes receive redundant email
5 messages
2015/01/23
[ruby-core:67555] Re: [ruby-cvs:56375] usa:r49225 (trunk): * test/ruby/test_numeric.rb (TestNumeric#test_coerce): fixed wrong message.
From:
Eric Wong <normalperson@...>
Date:
2015-01-12 21:30:25 UTC
List:
ruby-core #67555
Oops, r49225 is a 64-bit specific change and my original r49224
was only tested on 32-bit.
How about making error messages consistent across platforms?
Subject: [PATCH] numeric: use consistent message for 32 and 64-bit
rb_special_const_p is true for flonum, but 32-bit platforms
do not have flonum support, so we show the class name instead.
* numeric.c (coerce_failed): consistent message for 32 and 64-bit
* test/ruby/test_numeric.rb (test_coerce): fix for 32-bit
---
numeric.c | 9 +++++++--
test/ruby/test_numeric.rb | 2 +-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/numeric.c b/numeric.c
index 7458797..a8a0024 100644
--- a/numeric.c
+++ b/numeric.c
@@ -237,9 +237,14 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y));
static void
coerce_failed(VALUE x, VALUE y)
{
+ if (!rb_special_const_p(y) || FLONUM_P(y)) {
+ y = rb_obj_class(y);
+ }
+ else {
+ y = rb_inspect(y);
+ }
rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
- (rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)),
- rb_obj_class(x));
+ y, rb_obj_class(x));
}
static VALUE
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index 4c94c69..9c5d762 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -34,7 +34,7 @@ class TestNumeric < Test::Unit::TestCase
end
bug10711 = '[ruby-core:67405] [Bug #10711]'
- exp = "1.2 can't be coerced into Fixnum"
+ exp = "Float can't be coerced into Fixnum"
assert_raise_with_message(TypeError, exp, bug10711) { 1 & 1.2 }
end
--
EW