predicates-rs icon indicating copy to clipboard operation
predicates-rs copied to clipboard

Show diff horizontally aligned?

Open sourcefrog opened this issue 5 years ago • 0 comments

The string diffs from predicates are great, but would be easier to read if they started in the same column.

I have this code using assert_fs:

    temp.child("subdir")
        .child("subfile")
        .assert("Must I paint you a picture");

I get this output:

---- transport::local::test::write_file stdout ----
thread 'transport::local::test::write_file' panicked at 'Unexpected file, failed var - original <= 0
└── var - original <= 0
    ├── original: Must I paint you a picture
    ├── actual distance: 2
    ├── diff: Must I paint you a picture
Must I paint you a picture?

    └── var as str: Must I paint you a picture?

I would prefer something like this:

---- transport::local::test::write_file stdout ----
thread 'transport::local::test::write_file' panicked at 'Unexpected file, failed var - original <= 0
└── var - original <= 0
    ├── original: Must I paint you a picture
    ├── actual distance: 2
    ├── diff: 
Must I paint you a picture
Must I paint you a picture?
    └── var as str: Must I paint you a picture?

Meta

predicates-rs version: 1.0.4 rustc --version --verbose:

rustc 1.45.0-beta.3359 (b7dc83a3f 2020-06-03)
binary: rustc
commit-hash: b7dc83a3f6ca9746fb3d121761c3605477b77d90
commit-date: 2020-06-03
host: x86_64-apple-darwin
release: 1.45.0-beta.3359
LLVM version: 10.0

sourcefrog avatar Jun 10 '20 02:06 sourcefrog