From 3ab60f6ad85ce8af7248d853f94eb9293f46008f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Mon, 11 Feb 2013 18:17:00 -0800 Subject: [PATCH] Add anchor order test. Anchors should be emitted in ascending order. --- test/psych/test_alias_and_anchor.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/psych/test_alias_and_anchor.rb b/test/psych/test_alias_and_anchor.rb index 7cb5a6e5..f42ca287 100644 --- a/test/psych/test_alias_and_anchor.rb +++ b/test/psych/test_alias_and_anchor.rb @@ -92,5 +92,18 @@ def test_anchor_alias_round_trip_substring_with_ivars assert_equal('test', el.var1) end end + + def test_anchor_order_is_numerically_ascending + a = [] + b = [a, a] + c = [b, b] + assert_equal(Psych.dump(c), <