Skip to content

Commit

Permalink
Fix attribute error in JSON testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Nov 8, 2020
1 parent 9ca0856 commit 99d4784
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/run-make-fulldeps/rustdoc-json/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# `index` or `paths` mappings. To add a new test run `rustdoc --output-format json -o . yourtest.rs`
# and then create `yourtest.expected` by stripping unnecessary details from `yourtest.json`.

import copy
import sys
import json
import types
Expand Down Expand Up @@ -43,7 +44,7 @@ def _check_subset(expected, actual, trace):
for key in expected:
if key not in actual:
raise SubsetException("Key `{}` not found in output".format(key), trace)
new_trace = trace.copy()
new_trace = copy.deepcopy(trace)
new_trace.append(key)
_check_subset(expected[key], actual[key], new_trace)
elif expected_type is list:
Expand All @@ -54,7 +55,7 @@ def _check_subset(expected, actual, trace):
"Found {} items, expected {}".format(expected_elements, actual_elements), trace
)
for expected, actual in zip(expected, actual):
new_trace = trace.copy()
new_trace = copy.deepcopy(trace)
new_trace.append(expected)
_check_subset(expected, actual, new_trace)
elif expected_type is ID and expected not in already_checked:
Expand Down

0 comments on commit 99d4784

Please sign in to comment.