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

Function test_drain_signals_ignores_pending_break

std/src/exec.rs:248–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246
247 #[test]
248 fn test_drain_signals_ignores_pending_break() {
249 let (tx, rx) = async_channel::unbounded();
250 let mut machine = MachineBuilder::default().with_signals_chan((tx.clone(), rx)).build();
251
252 block_on(tx.send(Signal::Break)).unwrap();
253 machine.drain_signals();
254
255 machine.compile(&mut "a = 1".as_bytes()).unwrap();
256 match block_on(machine.exec()) {
257 Ok(None) => (),
258 r => panic!("Expected Ok(None) but got {:?}", r),
259 }
260 assert_eq!(0, tx.len());
261 }
262
263 fn do_no_check_stop_test(code: &str) {
264 let (tx, rx) = async_channel::unbounded();

Callers

nothing calls this directly

Calls 6

with_signals_chanMethod · 0.80
drain_signalsMethod · 0.80
as_bytesMethod · 0.80
buildMethod · 0.45
compileMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected