зеркало из https://github.com/github/ruby.git
* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
allocation framework right now. [ruby-core:41710] [Bug #5773] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
cf2bbc89d2
Коммит
9c00c1234d
|
@ -1,3 +1,8 @@
|
|||
Sun Dec 18 14:34:31 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): does not follow
|
||||
allocation framework right now. [ruby-core:41710] [Bug #5773]
|
||||
|
||||
Sun Dec 18 12:42:48 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
|
||||
|
|
|
@ -2830,12 +2830,16 @@ Init_bigdecimal(void)
|
|||
|
||||
/* Class and method registration */
|
||||
rb_cBigDecimal = rb_define_class("BigDecimal",rb_cNumeric);
|
||||
rb_undef_alloc_func(rb_cBigDecimal); /* TODO: define alloc func */
|
||||
|
||||
/* Global function */
|
||||
rb_define_global_function("BigDecimal", BigDecimal_global_new, -1);
|
||||
|
||||
/* Class methods */
|
||||
#if 1
|
||||
/* TODO: follow allocation framework */
|
||||
rb_define_singleton_method(rb_cBigDecimal, "new", BigDecimal_new, -1);
|
||||
#endif
|
||||
rb_define_singleton_method(rb_cBigDecimal, "mode", BigDecimal_mode, -1);
|
||||
rb_define_singleton_method(rb_cBigDecimal, "limit", BigDecimal_limit, -1);
|
||||
rb_define_singleton_method(rb_cBigDecimal, "double_fig", BigDecimal_double_fig, 0);
|
||||
|
|
|
@ -19,6 +19,10 @@ class TestBigDecimal < Test::Unit::TestCase
|
|||
[ BigDecimal::ROUND_FLOOR, :floor],
|
||||
]
|
||||
|
||||
def assert_allocate
|
||||
assert_raise(TypeError) {BigDecimal.allocate}
|
||||
end
|
||||
|
||||
def assert_nan(x)
|
||||
assert(x.nan?, "Expected #{x.inspect} to be NaN")
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче