[macruby-changes] [4847] MacRuby/trunk/ext/bigdecimal/bigdecimal.c
source_changes at macosforge.org
source_changes at macosforge.org
Fri Oct 29 09:47:34 PDT 2010
Revision: 4847
http://trac.macosforge.org/projects/ruby/changeset/4847
Author: watson1978 at gmail.com
Date: 2010-10-29 09:47:33 -0700 (Fri, 29 Oct 2010)
Log Message:
-----------
will throw an exception When compare it with nil in BigDecimal.
Test Script:
{{{
require 'test/unit/assertions.rb'
require 'bigdecimal'
include Test::Unit::Assertions
zero = BigDecimal("0")
assert_raise(ArgumentError){ zero > nil }
assert_raise(ArgumentError){ zero >= nil }
assert_raise(ArgumentError){ zero < nil }
assert_raise(ArgumentError){ zero <= nil }
assert_nothing_raised { zero == nil }
}}}
Modified Paths:
--------------
MacRuby/trunk/ext/bigdecimal/bigdecimal.c
Modified: MacRuby/trunk/ext/bigdecimal/bigdecimal.c
===================================================================
--- MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-10-29 16:47:27 UTC (rev 4846)
+++ MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-10-29 16:47:33 UTC (rev 4847)
@@ -716,7 +716,7 @@
case 'L': f = rb_intern("<="); break;
case '>': case '<': f = (ID)op; break;
}
- return rb_num_coerce_cmp(self,r,f);
+ return rb_num_coerce_relop(self,r,f);
}
SAVE(b);
e = VpComp(a, b);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101029/cf45c287/attachment.html>
More information about the macruby-changes
mailing list