From 2422a9fc3aeff3c60c6510efbf655a34218c7605 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 3 Oct 2011 14:23:10 -0700 Subject: Avoid accepting incorrect floating point values. --- test/psych/test_numeric.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/psych/test_numeric.rb (limited to 'test') diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb new file mode 100644 index 0000000..9adb058 --- /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 -- cgit v1.2.3