exec-target

Crates.ioexec-target
lib.rsexec-target
version0.2.9
sourcesrc
created_at2021-07-03 00:28:19.491159
updated_at2023-02-12 00:52:17.636552
descriptionthe simple invoke command for test
homepage
repositoryhttps://github.com/aki-akaguma/exec-target
max_upload_size
id418067
size31,402
(aki-akaguma)

documentation

README

exec-target

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

the simple invoke command for test

This invokes external a command and manipulates standard in out. You can use std::process::Command more easily.

Features

  • minimum support rustc 1.56.1 (59eed8a2a 2021-11-01)

Example

use exec_target::exec_target_with_env_in;

let command = "target/debug/exe-stab-grep";
let args = &["--color=always", "-e", "c"];
let envs = vec![("GREP_COLORS", "ms=01;32")];
let inp = b"abcdefg\n" as &[u8];

let oup = exec_target_with_env_in(command, args, envs, inp);

assert_eq!(oup.stderr, "");
assert_eq!(oup.stdout, "ab\u{1b}[01;32m\u{1b}[Kc\u{1b}[m\u{1b}[Kdefg\n");
assert_eq!(oup.status.success(), true);

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.

Commit count: 19

cargo fmt