mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import bigdecimal-1.4.0.pre.20181220a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181214a..v1.4.0.pre.20181220a git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
feb78840c8
commit
ccdba542d3
5 changed files with 11 additions and 3 deletions
|
@ -4271,7 +4271,7 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
|
|||
while (ISSPACE(szVal[j])) ++j;
|
||||
|
||||
/* Invalid character */
|
||||
if (szVal[j]) {
|
||||
if (szVal[j] && strict_p) {
|
||||
goto invalid_value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# coding: utf-8
|
||||
|
||||
bigdecimal_version = '1.4.0.pre.20181214a'
|
||||
bigdecimal_version = '1.4.0.pre.20181220a'
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "bigdecimal"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
extconf.h: $(srcdir)/$(GEMSPEC)
|
||||
Makefile: $(srcdir)/lib/bigdecimal.rb
|
||||
Makefile: $(BIGDECIMAL_RB)
|
||||
|
||||
# AUTOGENERATED DEPENDENCIES START
|
||||
bigdecimal.o: $(RUBY_EXTCONF_H)
|
||||
|
|
|
@ -28,6 +28,13 @@ have_func("rb_rational_den", "ruby.h")
|
|||
have_func("rb_array_const_ptr", "ruby.h")
|
||||
have_func("rb_sym2str", "ruby.h")
|
||||
|
||||
if File.file?(File.expand_path('../lib/bigdecimal.rb', __FILE__))
|
||||
bigdecimal_rb = "$(srcdir)/lib/bigdecimal.rb"
|
||||
else
|
||||
bigdecimal_rb = "$(srcdir)/../../lib/bigdecimal.rb"
|
||||
end
|
||||
|
||||
create_makefile('bigdecimal') {|mf|
|
||||
mf << "GEMSPEC = #{gemspec_name}\n"
|
||||
mf << "BIGDECIMAL_RB = #{bigdecimal_rb}\n"
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ class TestBigDecimalUtil < Test::Unit::TestCase
|
|||
assert_equal(BigDecimal('0.1'), "0.1_e10".to_d)
|
||||
assert_equal(BigDecimal('0.1'), "0.1e_10".to_d)
|
||||
assert_equal(BigDecimal('1'), "0.1e1__0".to_d)
|
||||
assert_equal(BigDecimal('1.2'), "1.2.3".to_d)
|
||||
|
||||
assert("2.5".to_d.frozen?)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue