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

Document a common assertion failure output format so IDEs can integrate "click to show diff" better #72

Open
vlsi opened this issue Feb 21, 2023 · 0 comments

Comments

@vlsi
Copy link

vlsi commented Feb 21, 2023

Currently, IDEs hardcode regular expressions which becomes problematic for cases outside of expected.equals(actual).
For instance, if the user compares file contents, they would rather want file contents printed on the screen with a short diff, and then IDE should add click to see diff link based on the file paths.

At the same time, if the expected or actual texts get big, the test framework might want saving them as file, to prevent displaying too large text to the console.

I incline it is not practical to add more text-based regexps for IDE integration, so I wonder if there can be an actual protocol for IDE integration.

See https://youtrack.jetbrains.com/issue/IDEA-313769/Support-click-to-see-difference-for-file-based-comparisons

For example:

{
  "type": "file_content_equal",
  "expected": {"path": "/tmp/expected.txt"}
  "actual": {"path": "/git/repo/actual.txt", "updateable": "true"}
}

updateable: true could mean the IDE could add a button to update actual file based on the contents of the expected one.

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

No branches or pull requests

1 participant