use std::path::PathBuf;
use std::process::Command;
fn pounce_exe() -> PathBuf {
PathBuf::from(env!("CARGO_BIN_EXE_pounce"))
}
fn fixture_path() -> PathBuf {
let mut p = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
p.push("tests");
p.push("fixtures_issue_49");
p.push("idaes_helmholtz.nl");
p
}
#[test]
fn pounce_rejects_external_function_problem_without_amplfunc() {
let out = Command::new(pounce_exe())
.env_remove("AMPLFUNC")
.arg(fixture_path())
.output()
.expect("spawn pounce binary");
assert!(!out.status.success(), "pounce should fail without AMPLFUNC");
let combined = format!(
"{}{}",
String::from_utf8_lossy(&out.stdout),
String::from_utf8_lossy(&out.stderr)
);
assert!(
combined.contains("AMPLFUNC") || combined.to_lowercase().contains("external function"),
"error should mention AMPLFUNC or external functions, got: {combined}"
);
}