summaryrefslogtreecommitdiff
path: root/test/psych
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych')
-rw-r--r--test/psych/test_numeric.rb4
-rw-r--r--test/psych/test_string.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb
index 200a9f0171..0858e799aa 100644
--- a/test/psych/test_numeric.rb
+++ b/test/psych/test_numeric.rb
@@ -16,6 +16,10 @@ module Psych
$DEBUG = @old_debug
end
+ def test_load_float_with_dot
+ assert_equal 1.0, Psych.load('--- 1.')
+ end
+
def test_non_float_with_0
str = Psych.load('--- 090')
assert_equal '090', str
diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb
index 0c5d4d2625..aa6866b618 100644
--- a/test/psych/test_string.rb
+++ b/test/psych/test_string.rb
@@ -102,6 +102,10 @@ module Psych
assert_cycle string
end
+ def test_float_confusion
+ assert_cycle '1.'
+ end
+
def binary_string percentage = 0.31, length = 100
string = ''
(percentage * length).to_i.times do |i|