mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 06:45:32 +00:00
25 lines
645 B
Rust
25 lines
645 B
Rust
|
|
use std::process::Command;
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
fn test_help_flag() {
|
||
|
|
let output = Command::new("cargo")
|
||
|
|
.args(&["run", "--", "--version"])
|
||
|
|
.output()
|
||
|
|
.expect("Failed to execute command");
|
||
|
|
|
||
|
|
let stdout = String::from_utf8_lossy(&output.stdout);
|
||
|
|
assert!(stdout.contains("krust"));
|
||
|
|
assert!(output.status.success());
|
||
|
|
}
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
fn test_basic_run() {
|
||
|
|
let output = Command::new("cargo")
|
||
|
|
.arg("run")
|
||
|
|
.output()
|
||
|
|
.expect("Failed to execute command");
|
||
|
|
|
||
|
|
let stdout = String::from_utf8_lossy(&output.stdout);
|
||
|
|
assert!(stdout.contains("Hello from krust!"));
|
||
|
|
assert!(output.status.success());
|
||
|
|
}
|