v: utilize new diff functions p1 #21431
Merged
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.
Regarding the utilization of the new diff functions.
Currently, printing diffs has different approaches in the code base. Below I'm pointing out the two with major differences.
This is because when integrating the new diff functions, things can also be improved and made more consistent. So this PR should allow us to decide on one version that might be more suited then the other. Then it could serve as preferred way when updating the new diff functions in other places. I hope that going about it like this will help to create more clarity and simplify subsequent changes.
Approach 1. (visible in the updated
vlib/v/compiler_errors_test.v
)Prints diffs OR expected and found.
Approach 2. (visible in the old diff of
slow_tests/inout/compiler_test.v
)Prints first expected then found AND then differences. This is currently used more frequently.
Atm. the PR updates slow_tests/inout/compiler_test.v from A2 to A1. Resulting in: