plancheck: Include known value in error message when asserting an unknown value #456
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.
Closes #450
Previously, we only checked the
AfterUnknownsection of the JSON plan when asserting if a value was unknown, this can lead to a confusing error messages when the path is correct, but a known value was present instead, resulting in a "path not found" error.It looks like previously there was some logic for handling known values, but that only applied to nested/collection paths looking for unknown values (as well as the error message didn't include the actual value).
This PR improves the error messaging for all of the unknown value checks by looking for a known value at the same path. If it can't find a value in either, then the error message will stay the same.