From 0b7cfdca09651f2eae5cd0e8ae4efed5033493f2 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Fri, 22 Jul 2022 16:45:03 -0400 Subject: [ruby/psych] Test that recursive refs dump as aliases https://github.com/ruby/psych/commit/d9f7289190 --- test/psych/test_array.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/psych/test_array.rb') diff --git a/test/psych/test_array.rb b/test/psych/test_array.rb index 28b76da785..a6be0baf2f 100644 --- a/test/psych/test_array.rb +++ b/test/psych/test_array.rb @@ -57,6 +57,19 @@ module Psych assert_cycle(@list) end + def test_recursive_array_uses_alias + @list << @list + + expected = <<~eoyaml + --- &1 + - :a: b + - foo + - *1 + eoyaml + + assert_equal expected, Psych.dump(@list) + end + def test_cycle assert_cycle(@list) end -- cgit v1.2.1