From b104e2524ddd8f8c34918a31dbfca54169dd0535 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 9 Jan 2013 19:26:45 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: strip trailing dots from floats so that Float() will not raise an exception. * test/psych/test_numeric.rb: test to ensure "1." can be loaded * test/psych/test_string.rb: make sure "1." can round trip git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_numeric.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/psych/test_numeric.rb') diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb index 200a9f0171..0858e799aa 100644 --- a/test/psych/test_numeric.rb +++ b/test/psych/test_numeric.rb @@ -16,6 +16,10 @@ module Psych $DEBUG = @old_debug end + def test_load_float_with_dot + assert_equal 1.0, Psych.load('--- 1.') + end + def test_non_float_with_0 str = Psych.load('--- 090') assert_equal '090', str -- cgit v1.2.3