diff options
-rw-r--r-- | lib/psych/scalar_scanner.rb | 2 | ||||
-rw-r--r-- | test/visitors/test_yast_builder.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index e8cd748..20f694d 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -37,8 +37,8 @@ module Psych [:FLOAT, i] else - return [:FLOAT, Float(@string.gsub(/[,_]/, ''))] rescue ArgumentError return [:INTEGER, Integer(@string.gsub(/[,_]/, ''))] rescue ArgumentError + return [:FLOAT, Float(@string.gsub(/[,_]/, ''))] rescue ArgumentError [:SCALAR, @string] end diff --git a/test/visitors/test_yast_builder.rb b/test/visitors/test_yast_builder.rb index e70713c..9a074e1 100644 --- a/test/visitors/test_yast_builder.rb +++ b/test/visitors/test_yast_builder.rb @@ -41,6 +41,7 @@ module Psych def test_list assert_round_trip(%w{ a b }) + assert_round_trip([1, 2.2]) end def test_symbol |