diff src/testdir/test55.in @ 2634:fcb916bed51a v7.3.055

updated for version 7.3.055 Problem: Recursively nested lists and dictionaries cause a near-endless loop when comparing them with a copy. (ZyX) Solution: Limit recursiveness in a way that non-recursive structures can still be nested very deep. Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok
author Bram Moolenaar <bram@vim.org>
date Wed, 10 Nov 2010 20:41:57 +0100
parents b62965091b8d
children 02440d1fcc9a
line wrap: on
line diff
--- a/src/testdir/test55.in
+++ b/src/testdir/test55.in
@@ -342,7 +342,18 @@ let l = [0, 1, 2, 3]
 :$put =(d == d)
 :$put =(l != deepcopy(l))
 :$put =(d != deepcopy(d))
+:"
+:" compare complex recursively linked list and dict
+:let l = []
+:call add(l, l)
+:let dict4 = {"l": l}
+:call add(dict4.l, dict4)
+:let lcopy = deepcopy(l)
+:let dict4copy = deepcopy(dict4)
+:$put =(l == lcopy)
+:$put =(dict4 == dict4copy)
 :endfun
+:"
 :call Test(1, 2, [3, 4], {5: 6})  " This may take a while
 :"
 :delfunc Test