Test that SIGINT interrupts non-terminating goals on unix.

Cleanup: use tokio::test instead of special test helpers

Added pty_exec.py helper script to run binaries with a pseudoterminal attached (bug won't trigger otherwise).

Tested CI to fail on all unixes (ubuntu+macos) with older rustyline, and pass with new one.
This commit is contained in:
Danil Platonov
2026-05-30 11:45:57 -07:00
parent 8b6d68a4cd
commit 39c850b4f4
5 changed files with 69 additions and 40 deletions

View File

@@ -38,41 +38,6 @@ pub(crate) fn load_module_test<T: Expectable>(file: &str, expected: T) {
expected.assert_eq(wam.test_load_file(file).as_slice());
}
/// Same as `load_module_test` with tokio runtime
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn load_module_test_with_tokio_runtime<T: Expectable>(file: &str, expected: T) {
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
runtime.block_on(async move {
let mut wam = MachineBuilder::default().build();
expected.assert_eq(wam.test_load_file(file).as_slice())
});
}
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn load_module_test_with_tokio_runtime_and_input<T: Expectable>(
file: &str,
input: impl Into<Cow<'static, str>>,
expected: T,
) {
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
runtime.block_on(async move {
let mut wam = MachineBuilder::default()
.with_streams(
StreamConfig::in_memory().with_user_input(InputStreamConfig::string(input)),
)
.build();
expected.assert_eq(wam.test_load_file(file).as_slice())
});
}
pub(crate) fn load_module_test_with_input<T: Expectable>(
file: &str,
input: impl Into<Cow<'static, str>>,