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

fix(testing/_diff) Don't merge diff when a token that is surrounded by word-diffs isn't a space #1032

Merged

Conversation

FujiHaruka
Copy link
Contributor

Thanks to #948 by @lowlighter's great contribution, strings diff of assertion is now very readable.

But I found some edge case that strings diff displays like unwelcome.

It's a feature of merging word diffs if a in-between token is a space. Actually word diffs are merged even when the in-between token is not a space.

For example, this is as expected. Fine.

foo bar vs yoo yoo

However, this is not as expected.

2 71 vs 3 14

And this is also not as expected.

It's vs Don't

That's the issue. So this PR fixes it not to merge if the in-between token is not a space.

After fixed, above 2 bad examples will be improved as below.

2 71 vs 3 14 (expected)

It's vs Don't (expected)

Copy link
Contributor

@wperron wperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@wperron wperron merged commit 1c96a57 into denoland:main Jul 13, 2021
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.

2 participants