[][src]Function stipulate::test_output

pub fn test_output(
    cmd: &str,
    args: &[&str],
    input: &str,
    expected_output: &str,
    timeout: Option<Duration>
) -> Result<TestAnswer, String>

Runs the given command with the given args, and passes the given argument as input through standard input. It returns true iff the command's output matches expected_output.

If timeout is None, then it will wait for the child to finish. Otherwise, it will only wait the specified amount of time.

It returns true if it matches, false if it doesn't match, and Err if it encountered an error trying to evaluate it (with an &str explaining the error caused).

For now, it assumes that the child process sends valid UTF-8 out. If it doesn't, then this function will error.