Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Feature: show line numbers and/or context in diffs #17

Closed
colin-kiegel opened this issue Mar 21, 2017 · 2 comments
Closed

Feature: show line numbers and/or context in diffs #17

colin-kiegel opened this issue Mar 21, 2017 · 2 comments

Comments

@colin-kiegel
Copy link
Collaborator

colin-kiegel commented Mar 21, 2017

Just a random idea. :-)

git diffs provide some context and line numbers. If the output is really huge and lines are similar, this might be helpful - but certainly not straightforward. Should probably even be implement upstream first in the difference crate.

@@ -93,7 +93,7 @@
 #[derive(Debug)]
 pub struct Assert {
     cmd: Vec<String>,
-    expect_success: bool,
+    expect_success: Option<bool>,
     expect_exit_code: Option<i32>,
     expect_stdout: Option<OutputAssertion>,
     expect_stderr: Option<OutputAssertion>,

instead of

-    expect_success: bool,
+    expect_success: Option<bool>,
@epage
Copy link
Collaborator

epage commented Sep 27, 2017

I'm assuming this issue is about .is() output predicate (formerly prints_exactly).

While line numbers aren't included, I am seeing the context being given

---- experiment stdout ----
        thread 'experiment' panicked at 'CLI assertion failed: `echo Lorem ipsum dolor sit amet, consectetur adipisicing elit,
                                sed do eiusmod tempor incididunt ut labore et dolore magna
                                aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                                ullamco laboris nisi ut aliquip ex ea commodo consequat.` StdOut mismatch: diff:
 Lorem ipsum dolor sit amet, consectetur adipisicing elit,
-sed do eiusmod tempor **incididunt** ut labore et dolore magna
+sed do eiusmod tempor incididunt ut labore et dolore magna
                                 aliqua. Ut enim ad minim veniam, quis nostrud exercitation
                                ullamco laboris nisi ut aliquip ex ea commodo consequat.
', /home/epage/git/assert_cli/src/assert.rs:289:12

(output tweaked slightly for some experiments I'm doing)

@epage
Copy link
Collaborator

epage commented May 29, 2018

The responsibility for this is moving into assert_cmd / predicates-rs. This will be addressed in assert-rs/predicates-rs#46

Assert_cli is being refactored. See #41

@epage epage closed this as completed May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants