summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-15 17:56:05 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-15 17:56:05 +0000
commit686fbc8e5f28f678e7bf5cf8afc44f15ffe9c22f (patch)
treebaaae4f1dc832f1c5290f8a08affd0f2f1e8247f /test
parent72e63983e6868d0253968f391632be89b7038ace (diff)
merge revision(s) 55497,55498,55504: [Backport #11988]
* ext/psych/*, test/psych/*: Upate psych 2.1.0 This version fixed [Bug #11988][ruby-core:72850] * ext/psych/*, test/psych/*: Update psych 2.1.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb5
-rw-r--r--test/psych/visitors/test_yaml_tree.rb6
2 files changed, 11 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 7de9e07fdc..508519b012 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -144,6 +144,11 @@ class TestPsych < Psych::TestCase
}
end
+ def test_load_file_with_fallback
+ t = Tempfile.create(['empty', 'yml'])
+ assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+ end
+
def test_parse_file
Tempfile.create(['yikes', 'yml']) {|t|
t.binmode
diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb
index b3890bcd72..5755f5863e 100644
--- a/test/psych/visitors/test_yaml_tree.rb
+++ b/test/psych/visitors/test_yaml_tree.rb
@@ -156,6 +156,12 @@ module Psych
assert_equal(-1, Psych.load(Psych.dump(-1 / 0.0)).infinite?)
end
+ def test_string
+ assert_match(/'017'/, Psych.dump({'a' => '017'}))
+ assert_match(/'019'/, Psych.dump({'a' => '019'}))
+ assert_match(/'01818'/, Psych.dump({'a' => '01818'}))
+ end
+
# http://yaml.org/type/null.html
def test_nil
assert_cycle nil