summaryrefslogtreecommitdiff
path: root/test/yaml/test_yaml.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/yaml/test_yaml.rb')
-rw-r--r--test/yaml/test_yaml.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index 78a0877..676310e 100644
--- a/test/yaml/test_yaml.rb
+++ b/test/yaml/test_yaml.rb
@@ -1253,6 +1253,25 @@ EOY
assert_cycle(NumericTest.new(3)) # Subclass of Numeric
end
+ #
+ # Test empty map/seq in map cycle
+ #
+ def test_empty_map_key
+ #
+ # empty seq as key
+ #
+ o = YAML.load({[]=>""}.to_yaml)
+ assert_equal(Hash, o.class)
+ assert_equal([[]], o.keys)
+
+ #
+ # empty map as key
+ #
+ o = YAML.load({{}=>""}.to_yaml)
+ assert_equal(Hash, o.class)
+ assert_equal([{}], o.keys)
+ end
+
end
if $0 == __FILE__