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.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb
index 676310e..023a8b9 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__