mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
1721fca3ad
commit
bd3b0d470c
3 changed files with 31 additions and 1 deletions
14
test/psych/test_numeric.rb
Normal file
14
test/psych/test_numeric.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue