MCPcopy Create free account
hub / github.com/endbasic/endbasic / do_no_check_stop_test

Function do_no_check_stop_test

std/src/exec.rs:263–276  ·  view source on GitHub ↗
(code: &str)

Source from the content-addressed store, hash-verified

261 }
262
263 fn do_no_check_stop_test(code: &str) {
264 let (tx, rx) = async_channel::unbounded();
265 let mut machine = MachineBuilder::default().with_signals_chan((tx.clone(), rx)).build();
266
267 block_on(tx.send(Signal::Break)).unwrap();
268
269 machine.compile(&mut code.as_bytes()).unwrap();
270 match block_on(machine.exec()) {
271 Ok(None) => (),
272 r => panic!("Expected Ok(None) but got {:?}", r),
273 }
274
275 assert_eq!(1, tx.len());
276 }
277
278 fn do_check_stop_test(code: &str) {
279 let (tx, rx) = async_channel::unbounded();

Calls 5

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