Skip to content

Distinction between Assert::set_stdin() and with_stdin is confusing #29

Closed
@zetok

Description

@zetok

No idea if it doesn't actually work, or if I'm doing something wrong and API is simply allowing for it, but either way it should be fixed.

assert_cmd = "0.6"

my test case:

#[test]
fn broek_dep() {
    Command::new("cat")
        .assert()
        .set_stdin(vec![0])
        .stdout("\0")
        .success();
}

Which results in:

thread 'broek_dep' panicked at 'Unexpected stdout
command=`"cat"`
stdin=``````
code=0
stdout=``````
stderr=``````
',

Also on a side note, output of assert_cmd when there's an error is rather confusing and not helpful when you're trying to deal with input/output that consists of raw, often unprintable, bytes. Debug output without additional ``` would work a lot better IMO.

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