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

Better output for strings #23

Open
Tarmil opened this issue Feb 6, 2023 · 0 comments
Open

Better output for strings #23

Tarmil opened this issue Feb 6, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Tarmil
Copy link
Member

Tarmil commented Feb 6, 2023

The output for different strings just prints the two strings on separate lines. This is fine for short strings, but for longer ones, especially multiline, it can be difficult to find where exactly the difference is. We could take inspiration from other assertion libraries that indicate at which character position the strings begin to differ, and only print the section of the string around that position.

Hint for the person who wants to take up this issue: I think the best way to go would be to add a case String of x1: string * x2: string to the type Diff. This case would be used in Differ.diffWith instead of simpleEquality (which returns a Diff.Value). Its display format would then be applied in DiffPrinter.toStreamImpl.

@Tarmil Tarmil added enhancement New feature or request good first issue Good for newcomers labels Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant