summaryrefslogtreecommitdiff
path: root/test/psych
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych')
-rw-r--r--test/psych/test_merge_keys.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/psych/test_merge_keys.rb b/test/psych/test_merge_keys.rb
index ba8d2e77b3..8b263e5186 100644
--- a/test/psych/test_merge_keys.rb
+++ b/test/psych/test_merge_keys.rb
@@ -6,6 +6,26 @@ module Psych
attr_reader :bar
end
+ def test_roundtrip_with_chevron_key
+ h = {}
+ v = { 'a' => h, '<<' => h }
+ assert_cycle v
+ end
+
+ def test_explicit_string
+ doc = Psych.load <<-eoyml
+a: &me { hello: world }
+b: { !!str '<<': *me }
+eoyml
+ expected = {
+ "a" => { "hello" => "world" },
+ "b" => {
+ "<<" => { "hello" => "world" }
+ }
+ }
+ assert_equal expected, doc
+ end
+
def test_mergekey_with_object
s = <<-eoyml
foo: &foo