nar_dev_utils::mod_and_pub_use! {
dialect
translators
launcher
}
#[cfg(test)]
mod tests {
use super::*;
use crate::{runtimes::CommandVmRuntime, tests::cin_paths::NARS_PYTHON};
use narsese::conversion::string::impl_lexical::shortcuts::*;
use navm::{
cmd::Cmd,
vm::{VmLauncher, VmRuntime},
};
#[test]
#[ignore = "【2024-04-14 20:24:52】会导致残留子进程"]
fn test() {
let exe_path = NARS_PYTHON;
let vm = NARSPython::new(exe_path).launch().expect("无法启动虚拟机");
_test_nars_python(vm)
}
pub(crate) fn _test_nars_python(mut vm: CommandVmRuntime) {
std::thread::sleep(std::time::Duration::from_secs(2));
vm.input_cmd(Cmd::NSE(nse_task!(<A --> B>.)))
.expect("无法输入NAVM指令");
vm.input_cmd(Cmd::NSE(nse_task!(<B --> C>.)))
.expect("无法输入NAVM指令");
vm.input_cmd(Cmd::NSE(nse_task!(<A --> C>?)))
.expect("无法输入NAVM指令");
std::thread::sleep(std::time::Duration::from_secs(4));
vm.terminate().expect("无法终止虚拟机");
}
}