mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/bigdecimal/bigdecimal.c (BigDecimal_save_limit):
return the result of a block. * test/bigdecimal/test_bigdecimal.rb (test_save_limit): add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6ad15393d
commit
ecfc868bdb
3 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Wed Sep 29 17:41:34 2010 Kenta Murata <mrkn@mrkn.jp>
|
||||||
|
|
||||||
|
* ext/bigdecimal/bigdecimal.c (BigDecimal_save_limit):
|
||||||
|
return the result of a block.
|
||||||
|
|
||||||
|
* test/bigdecimal/test_bigdecimal.rb (test_save_limit):
|
||||||
|
add a test for the above change.
|
||||||
|
|
||||||
Wed Sep 29 16:18:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Sep 29 16:18:03 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* vm_dump.c (dump_thread): remove ununsed optional arguments.
|
* vm_dump.c (dump_thread): remove ununsed optional arguments.
|
||||||
|
|
|
@ -1878,7 +1878,7 @@ BigDecimal_save_limit(VALUE self)
|
||||||
VALUE ret = rb_protect(rb_yield, Qnil, &state);
|
VALUE ret = rb_protect(rb_yield, Qnil, &state);
|
||||||
VpSetPrecLimit(limit);
|
VpSetPrecLimit(limit);
|
||||||
if (state) rb_jump_tag(state);
|
if (state) rb_jump_tag(state);
|
||||||
return Qnil;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Document-class: BigDecimal
|
/* Document-class: BigDecimal
|
||||||
|
|
|
@ -137,6 +137,8 @@ class TestBigDecimal < Test::Unit::TestCase
|
||||||
ensure
|
ensure
|
||||||
BigDecimal.limit(old)
|
BigDecimal.limit(old)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert_equal(42, BigDecimal.save_limit { 42 })
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_nan
|
def test_exception_nan
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue