diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 15:51:21 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 15:51:21 -0700 |
commit | 57c468a5f8bd3ffc1cb93b07db6b823872316a18 (patch) | |
tree | dad229aa55917b157c2eba2f76d9da3a7e947866 /test/visitors/test_to_ruby.rb | |
parent | 98ce58ac328aca5f5d541c9118b5e4184b916bd3 (diff) | |
download | psych-57c468a5f8bd3ffc1cb93b07db6b823872316a18.zip |
fixing float parsing
Diffstat (limited to 'test/visitors/test_to_ruby.rb')
-rw-r--r-- | test/visitors/test_to_ruby.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb index 9c37690..8bf9c91 100644 --- a/test/visitors/test_to_ruby.rb +++ b/test/visitors/test_to_ruby.rb @@ -173,6 +173,9 @@ module Psych i = Nodes::Scalar.new(num, nil, 'tag:yaml.org,2002:float') assert_equal 1000.3, i.to_ruby + i = Nodes::Scalar.new(num, nil, '!float') + assert_equal 1000.3, i.to_ruby + assert_equal 1000.3, Nodes::Scalar.new(num).to_ruby end end @@ -196,6 +199,9 @@ module Psych end def test_float + i = Nodes::Scalar.new('12', nil, 'tag:yaml.org,2002:float') + assert_equal 12.0, i.to_ruby + i = Nodes::Scalar.new('1.2', nil, 'tag:yaml.org,2002:float') assert_equal 1.2, i.to_ruby |