Skip to content

Commit 99d4784

Browse files
committed
Fix attribute error in JSON testsuite
1 parent 9ca0856 commit 99d4784

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/run-make-fulldeps/rustdoc-json/compare.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# `index` or `paths` mappings. To add a new test run `rustdoc --output-format json -o . yourtest.rs`
77
# and then create `yourtest.expected` by stripping unnecessary details from `yourtest.json`.
88

9+
import copy
910
import sys
1011
import json
1112
import types
@@ -43,7 +44,7 @@ def _check_subset(expected, actual, trace):
4344
for key in expected:
4445
if key not in actual:
4546
raise SubsetException("Key `{}` not found in output".format(key), trace)
46-
new_trace = trace.copy()
47+
new_trace = copy.deepcopy(trace)
4748
new_trace.append(key)
4849
_check_subset(expected[key], actual[key], new_trace)
4950
elif expected_type is list:
@@ -54,7 +55,7 @@ def _check_subset(expected, actual, trace):
5455
"Found {} items, expected {}".format(expected_elements, actual_elements), trace
5556
)
5657
for expected, actual in zip(expected, actual):
57-
new_trace = trace.copy()
58+
new_trace = copy.deepcopy(trace)
5859
new_trace.append(expected)
5960
_check_subset(expected, actual, new_trace)
6061
elif expected_type is ID and expected not in already_checked:

0 commit comments

Comments
 (0)