mock-io icon indicating copy to clipboard operation
mock-io copied to clipboard

Prettier dump on write mismatch (hex + diff)

Open akavel opened this issue 7 years ago • 4 comments

Sample output:

running 1 test
test existing_pkg_iodump ... FAILED

failures:

---- existing_pkg_iodump stdout ----
thread 'existing_pkg_iodump' panicked at 'assertion failed: `(left == right)`
  left: `[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]`,
 right: `[203, 238, 82, 84, 0, 0, 0, 0, 4, 2, 0]`: 
 hex written: [68, 65, 6c, 6c, 6f, 20, 77, 6f, 72, 6c, 64]
hex expected: [cb, ee, 52, 54, 00, 00, 00, 00, 04, 02, 00]
        DIFF:  ^^', /home/akavel/.cargo/git/checkouts/mock-io-4a9c6b3ff6c2f637/00444b0/src/lib.rs:235:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.

akavel avatar Dec 12 '18 22:12 akavel

Looks good to me! Do you know why CI is failing?

carllerche avatar Jan 12 '19 05:01 carllerche

@carllerche The CI log shows the following error:

$ cargo build --no-default-features
   Compiling mock-io v0.1.0 (/home/travis/build/carllerche/mock-io)
error[E0425]: cannot find function `async_read` in this scope
   --> src/lib.rs:311:13
    |
311 |             async_read(self, dst)
    |             ^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
71  | use tokio::async_read;
    |
                                                                                
error[E0425]: cannot find function `async_write` in this scope
   --> src/lib.rs:321:13
    |
321 |             async_write(self, src)
    |             ^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
71  | use tokio::async_write;
    |
                                                                                
error: aborting due to 2 previous errors
                                                                                
For more information about this error, try `rustc --explain E0425`.

— but that doesn't seem related to this PR to me? (Though please note I'm a Rust noob, thus the question mark in the previous sentence.) The #3 seems to mention that it might possibly be fixing this error?

akavel avatar Jan 14 '19 11:01 akavel

#3 is merged, maybe merging master into here would fix CI?

carllerche avatar Feb 20 '19 19:02 carllerche

Good idea, thanks! Done :heavy_check_mark: Seems to have helped indeed!

akavel avatar Mar 05 '19 19:03 akavel