Skip to content

Show faulty line in DifferencePredicate #112

Closed
@Chewie

Description

@Chewie

Heya,

The regular assert_eq! macro provides the line containing the assert in its output:

thread 'main' panicked at 'assertion failed:  `(left == right)`
  left: `4`,
 right: `2`, tests/test.rs:112:5

This information can be parsed by editors like Vim to fill the quickfix list automatically and jump to the error, which is very helpful.

Unfortunately, the DifferencePredicate doesn't show this information:

---- test_no_yaml stdout ----
thread 'main' panicked at 'Unexpected stdout, failed diff var original
├── original: No test case found. Exuting.

├── diff: 
--- value	expected
+++ value	actual
@@ -1 +1 @@
-No test case found. Exuting.
+No test case found. Exiting.

└── var as str: No test case found. Exiting.

Would it be possible to add this information to the output?

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