diff options
author | Alexander Momchilov <alexander.momchilov@shopify.com> | 2022-07-22 16:45:03 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-08-09 01:31:23 +0900 |
commit | 0b7cfdca09651f2eae5cd0e8ae4efed5033493f2 (patch) | |
tree | 548d2a2a85db2b4376b57c674e3a87525b0a9ee9 /test/psych/test_array.rb | |
parent | c851bced390204d6624e58c47941f34d0858b352 (diff) | |
download | ruby-0b7cfdca09651f2eae5cd0e8ae4efed5033493f2.tar.gz |
[ruby/psych] Test that recursive refs dump as aliases
https://github.com/ruby/psych/commit/d9f7289190
Diffstat (limited to 'test/psych/test_array.rb')
-rw-r--r-- | test/psych/test_array.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 |