#![allow(dead_code)]
use std::path::PathBuf;
#[must_use]
pub fn fixtures() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests")
.join("fixtures")
}
#[must_use]
pub fn polyglot_root() -> PathBuf {
fixtures().join("polyglot")
}
#[must_use]
pub fn semgrep_native() -> Vec<u8> {
read("native/semgrep-polyglot.json")
}
#[must_use]
pub fn cargo_audit_native() -> Vec<u8> {
read("native/cargo-audit.json")
}
fn read(relative: &str) -> Vec<u8> {
let path = fixtures().join(relative);
std::fs::read(&path).unwrap_or_else(|e| panic!("reading fixture {}: {e}", path.display()))
}
pub const REQUIRED_LANGUAGES: &[(&str, &str)] = &[
("rust", "rust/src/deploy.rs"),
("python", "python/app.py"),
("java", "java/ReportService.java"),
("node (javascript)", "node/server.js"),
("sql", "sql/schema.sql"),
];