summaryrefslogtreecommitdiff
path: root/test/psych/test_numeric.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-03 21:21:31 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-03 21:21:31 +0000
commitbd3b0d470c12fbdb48efcdb310d00eaa0fea84e5 (patch)
tree7504076747c9c32e5c4305a282445b73bd2045dc /test/psych/test_numeric.rb
parent1721fca3ada1c19211b01d7c8b18dac5e509fc0e (diff)
* ext/psych/lib/psych/scalar_scanner.rb: Match values against the
floating point spec defined in YAML to avoid erronious parses. * test/psych/test_numeric.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_numeric.rb')
-rw-r--r--test/psych/test_numeric.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb
new file mode 100644
index 0000000000..9adb058a32
--- /dev/null
+++ b/test/psych/test_numeric.rb
@@ -0,0 +1,14 @@
+require 'psych/helper'
+
+module Psych
+ ###
+ # Test numerics from YAML spec:
+ # http://yaml.org/type/float.html
+ # http://yaml.org/type/int.html
+ class TestNumeric < TestCase
+ def test_non_float_with_0
+ str = Psych.load('--- 090')
+ assert_equal '090', str
+ end
+ end
+end