jw-python/test/unit/python/jw
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Lindemann 568c92b009
load_yaml: Deepcopy cached link expansions
The memoisation cache in _expand_links_recursive() stores the expanded
value of a link node.  A link node that is first reached via another
link, and later visited by the normal tree walk, is expanded only
once; the cached result object is then returned as-is for the second
location.  Both places in the output tree end up holding the same
dict, so mutating one of them silently mutates the other.

Deepcopy the value on every cache read so that each place in the
output tree holds an independent object.  Add a regression test that
mutates one cached location and checks the others stay untouched.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-08-25 19:35:03 +02:00
..
util load_yaml: Deepcopy cached link expansions 2026-08-25 19:35:03 +02:00
Makefile stree.StringTree: Add unit tests 2026-08-12 23:10:12 +00:00