MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_drive_raw_keys_shutdown_without_extra_key

Function test_drive_raw_keys_shutdown_without_extra_key

terminal/src/lib.rs:489–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

487
488 #[test]
489 fn test_drive_raw_keys_shutdown_without_extra_key() {
490 let (on_key_tx, on_key_rx) = async_channel::unbounded();
491 let (signals_tx, _signals_rx) = async_channel::unbounded();
492 let events = stream::pending();
493
494 let handle = thread::spawn(move || {
495 let runtime =
496 tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
497 runtime.block_on(TerminalConsole::raw_key_handler(events, on_key_tx, signals_tx));
498 });
499
500 on_key_rx.close();
501 handle.join().unwrap();
502
503 assert_eq!(Err(TryRecvError::Closed), on_key_rx.try_recv());
504 }
505}

Callers

nothing calls this directly

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected