use std::process::Command;
const BIN: &str = env!("CARGO_BIN_EXE_tcode");
#[test]
fn config_help_advertises_keys_feature() {
let out = Command::new(BIN)
.args(["config", "--help"])
.output()
.expect("spawn `config --help`");
assert!(
out.status.success(),
"`config --help` should exit 0; stderr:\n{}",
String::from_utf8_lossy(&out.stderr)
);
let stdout = String::from_utf8_lossy(&out.stdout);
assert!(
stdout.contains("keys"),
"`config --help` should advertise the `keys` feature; got:\n{stdout}"
);
}
#[test]
fn config_keys_list_runs_offline() {
let out = Command::new(BIN)
.args(["config", "keys", "list"])
.output()
.expect("spawn `config keys list`");
assert!(
out.status.success(),
"`config keys list` should exit 0 offline; stderr:\n{}",
String::from_utf8_lossy(&out.stderr)
);
let stdout = String::from_utf8_lossy(&out.stdout);
assert!(
stdout.contains("Provider key status"),
"`config keys list` should print the status header; got:\n{stdout}"
);
}