Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v: utilize new diff functions p1 #21431

Merged
merged 2 commits into from
May 5, 2024
Merged

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented May 5, 2024

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:

    Current Updated
    Screenshot_20240505_134055 Screenshot_20240505_134927

@JalonSolov
Copy link
Contributor

Personally, I prefer brevity. If everything expected was found, why waste time/space reporting the 2 lists?

Perhaps it is useful sometimes. For those times, a verbose option would be handy, but I don't like verbosity as the default.

@ttytm
Copy link
Member Author

ttytm commented May 5, 2024

@JalonSolov I'm in the same boat. When the expected and found are plainly printed, it's easy to lose track. Especially when they get longer.

Having it less verbose and straight to the point when there is a working diff tool should help to spot what is important more quickly.

@spytheman spytheman merged commit ee22dcb into vlang:master May 5, 2024
57 checks passed
@ttytm ttytm deleted the v/use-new-diff-fns-1 branch May 5, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants