aboutsummaryrefslogtreecommitdiffstats
path: root/test/yaml
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-16 01:29:58 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-16 01:29:58 +0000
commitd54f7b05e8b2e516451fb50c816cec311db570bf (patch)
tree5279446ef37d5edd33566f25c046ce7532ebf1a6 /test/yaml
parent44bf6c8f492cc87d3faf7891bbb8fee989293cf7 (diff)
downloadruby-d54f7b05e8b2e516451fb50c816cec311db570bf.tar.gz
* ext/syck/emitter.c (syck_emit_seq, syck_emit_map, syck_emit_item):
should output complex key mark even if map's key is empty seq/map. [ruby-core:7129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/yaml')
-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 78a0877300..676310e6fc 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__