diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/yaml/test_yaml.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index 638ad88ede..91c0b59ef7 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -1272,6 +1272,14 @@ EOY assert_equal([{}], o.keys) end + # + # contributed by riley lynch [ruby-Bugs-8548] + # + def test_object_id_collision + omap = YAML::Omap.new + 1000.times { |i| omap["key_#{i}"] = { "value" => i } } + raise "id collision in ordered map" if omap.to_yaml =~ /id\d+/ + end end if $0 == __FILE__ |