diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-01-16 01:29:58 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-01-16 01:29:58 +0000 |
commit | fd8934462e51e74d57424fd3b3ae6bc7cb1112ac (patch) | |
tree | 537c74d113b17bbd1675db311a30f517ff72fd37 /test | |
parent | 480f79c9d4cffe085f30c93de94ec9936f4c4c84 (diff) | |
download | ruby-fd8934462e51e74d57424fd3b3ae6bc7cb1112ac.tar.gz ruby-fd8934462e51e74d57424fd3b3ae6bc7cb1112ac.tar.xz ruby-fd8934462e51e74d57424fd3b3ae6bc7cb1112ac.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/yaml/test_yaml.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index 78a087730..676310e6f 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__ |