Skip to content

Print color diff of actual and expected output to highlight non-printable symbols #262

Open
@ligurio

Description

@ligurio

Sometimes test output contains non-printable symbols and it is difficult to understand the difference between actual and expected output when such symbols present in test output.
The solution is implement color diffs that will highlight difference for strings.

Example: Python 3 changed JSON output by default and box-py/call.test.py test output has changed. But it is not clear a difference for both output:

[001] @@ -587,7 +587,7 @@
[001]  ---                   
[001]  {
[001]      "error": {                      
[001] -        "code": "ER_PROC_LUA", 
[001] +        "code": "ER_PROC_LUA",
[001]          "reason": "eval:1: unexpected symbol near '!'"
[001]      }
[001]  }
[001]

@Totktonada advised to use diffc that highlight difference that shows symbols absent in reference output:

image

To implement a feature we can use diffc or icdiff (https://github.com/jeffkaufman/icdiff).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions