pub fn petri_run_net(topo_file: &str, clm_root: &str) -> Result<String, String> {
crate::cpn::vm::petri_run_net(topo_file, clm_root)
}
#[cfg(test)]
mod tests {
use super::*;
use std::io::Write;
#[test]
fn test_dispatch_native_backend() {
let dir = std::env::temp_dir().join("clm_runtime_dispatch_native_test");
std::fs::create_dir_all(&dir).unwrap();
let path = dir.join("net.yaml");
{
let mut f = std::fs::File::create(&path).unwrap();
f.write_all(b"not a valid topology\n").unwrap();
}
let result = petri_run_net(path.to_str().unwrap(), "/tmp/clm_root");
assert!(result.is_err());
}
}