Skip to content

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

@vlsi

Description

@vlsi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions