Skip to content

Unable to test TTY behavior #138

Open
@snshn

Description

@snshn

Using crate atty:

let stdout_is_a_tty: bool = atty::is(Stream::Stdout);
if stdout_is_a_tty { "<encode data into lossy UTF-8 to print into the terminal>" } else { "<binary output>" }

When I run tests, stdout_is_a_tty is always false, hence I can't test the textual "to-terminal" output of my program, which I really need to test somehow. Ideally there should be some switch in assert_cmd... I really don't want to use env variables to force that behavior, it'd be very hacky.

Thank you for creating and maintaining this crate, really helps me test my software even the way it is right now!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprove the expectedquestionUncertainty is involved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions