Add a Diff Visitor for BlueprintZoneConfigs #7336
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This visitor walks a diffus generated diff and provides callbacks for users to hook into the parts of the diff that they care about.
To keep things minimal, we don't provide callback trait methods for copies (when nothing changes), and we don't provide methods for most diffus_derive generated types (the ones that start with
Edited
).We anticipate composing these visitors to build up a full diff of a Blueprint. They can also be used individually as demonstrated with the included property based test.
In order to easily generate
BlueprintZoneConfigs
for property tests we derivedArbitrary
forBlueprintZoneConfigs
and its fields using thetest-strategy
crate. Some of the types in the hierarchy don't actually implementArbitrary
and they come from foreign crates. In this case a corresponding generation strategy was added that allows those types to be generated based on more primitive types that do implement arbitrary.This PR is just one of many coming to build up and use automated blueprint diffs. It builds on the following PRs which must be merged in first: