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

Assert on string should show at least the first difference. #4261

Open
nohwnd opened this issue Dec 6, 2024 · 0 comments
Open

Assert on string should show at least the first difference. #4261

nohwnd opened this issue Dec 6, 2024 · 0 comments

Comments

@nohwnd
Copy link
Member

nohwnd commented Dec 6, 2024

Special case the AreEqual when the type is string and show at least the first diff of the string. Compare the mstest vs nunit vs xunit experience.

mstest
Image

nunit
Image

xunit
Image

advantages of nunit are that it uses ascii only characters, so we won't run into issues with the console not being utf8 #2491

A longer input should consider the size of the screen and select appropriate amount of characters, preferring the context before the diff, rather than putting them 50:50 or at the beginning. (at least this is my experience from Pester, where we changed the approach quite a lot)

For contexts where we don't know the output size we should select a reasonable minimum,

Image

Prefer showing the texts even when the sizes of the strings vary.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants