nar_dev_utils::mod_and_pub_use! {
translators
launcher
}
#[cfg(test)]
mod tests {
#![allow(unused)]
use super::*;
use crate::{runtimes::CommandVmRuntime, tests::cin_paths::OPENJUNARS};
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 jl_path = OPENJUNARS;
let vm = OpenJunars::new(jl_path).launch().expect("无法启动虚拟机");
_test_open_junars(vm)
}
pub(crate) fn _test_open_junars(mut vm: CommandVmRuntime) {
vm.input_cmd(Cmd::NSE(nse_task!(<A --> B>.)))
.expect("无法输入指令");
std::thread::sleep(std::time::Duration::from_secs(4));
vm.input_cmd(Cmd::NSE(nse_task!(<A --> B>.)))
.expect("无法输入指令");
std::thread::sleep(std::time::Duration::from_secs(1));
vm.input_cmd(Cmd::CYC(1)).expect("无法输入指令");
std::thread::sleep(std::time::Duration::from_secs(1));
vm.input_cmd(Cmd::NSE(nse_task!(<A --> B>?)))
.expect("无法输入指令");
std::thread::sleep(std::time::Duration::from_secs(1));
vm.input_cmd(Cmd::CYC(1)).expect("无法输入指令");
std::thread::sleep(std::time::Duration::from_secs(3));
while let Ok(Some(output)) = vm.try_fetch_output() {
dbg!(output);
}
std::thread::sleep(std::time::Duration::from_secs(2));
vm.terminate().expect("无法终止虚拟机");
}
}