#![cfg(target_family = "unix")]
mod support;
use support::pty::{PtySession, PtyShell};
use support::subprocess::{bash4_available, runex_bin_str, write_simple_config};
#[test]
fn space_triggers_expand_for_known_token() {
if !bash4_available() {
eprintln!("skipping: bash 4+ not available");
return;
}
let config = write_simple_config("gcm", "echo EXPANDED");
let Some(mut session) = PtySession::spawn(PtyShell::Bash, runex_bin_str(), config.path())
else {
eprintln!("skipping: could not spawn bash session");
return;
};
session.send("gcm ");
session.send_line("");
session
.expect_regex(r"EXPANDED")
.expect("bash should have echoed EXPANDED after the gcm<Space> expansion");
}