summaryrefslogtreecommitdiff
path: root/test/psych/test_psych.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-06-03 10:18:34 -0700
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-05 11:49:56 +0900
commit7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c (patch)
tree65fac445e5f7544cf2f513a1bd48c25e8a0f9c47 /test/psych/test_psych.rb
parent6b9e363aa08d7e9db9554827c6998af60ab39abc (diff)
downloadruby-7e289cdf3fed588b2d5a6973e29f9ff95cb8d76c.tar.gz
[ruby/psych] Fixing compatibility with libyaml 0.2.5
The main issue is that commas aren't allowed in local tags. libyaml was updated to follow the spec, and our tests were out of date. See: https://github.com/yaml/libyaml/issues/196 https://github.com/ruby/psych/commit/3f5e520fd3
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r--test/psych/test_psych.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 8fd9d278b5..55d9f19312 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -178,17 +178,17 @@ class TestPsych < Psych::TestCase
def test_domain_types
got = nil
- Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val|
+ Psych.add_domain_type 'foo.bar/2002', 'foo' do |type, val|
got = val
end
- Psych.load('--- !foo.bar,2002/foo hello')
+ Psych.load('--- !foo.bar/2002:foo hello')
assert_equal 'hello', got
- Psych.load("--- !foo.bar,2002/foo\n- hello\n- world")
+ Psych.load("--- !foo.bar/2002:foo\n- hello\n- world")
assert_equal %w{ hello world }, got
- Psych.load("--- !foo.bar,2002/foo\nhello: world")
+ Psych.load("--- !foo.bar/2002:foo\nhello: world")
assert_equal({ 'hello' => 'world' }, got)
end
@@ -311,16 +311,13 @@ class TestPsych < Psych::TestCase
types = []
appender = lambda { |*args| types << args }
- Psych.add_builtin_type('foo', &appender)
- Psych.add_domain_type('example.com,2002', 'foo', &appender)
+ Psych.add_domain_type('example.com:2002', 'foo', &appender)
Psych.load <<-eoyml
-- !tag:yaml.org,2002:foo bar
-- !tag:example.com,2002:foo bar
+- !tag:example.com:2002:foo bar
eoyml
assert_equal [
- ["tag:yaml.org,2002:foo", "bar"],
- ["tag:example.com,2002:foo", "bar"]
+ ["tag:example.com:2002:foo", "bar"]
], types
end