()
| 547 | |
| 548 | #[test] |
| 549 | fn test_run_repl_loop_signal_before_exec() { |
| 550 | let mut tester = Tester::default(); |
| 551 | let (console, program) = (tester.get_console(), tester.get_program()); |
| 552 | let (signals_tx, signals_rx) = async_channel::unbounded(); |
| 553 | let mut machine = endbasic_std::MachineBuilder::default() |
| 554 | .with_console(console.clone()) |
| 555 | .with_signals_chan((signals_tx.clone(), signals_rx)) |
| 556 | .build(); |
| 557 | |
| 558 | { |
| 559 | let mut console = console.borrow_mut(); |
| 560 | console.add_input_chars("PRINT"); |
| 561 | block_on(signals_tx.send(Signal::Break)).unwrap(); |
| 562 | console.add_input_chars(" 123"); |
| 563 | console.add_input_keys(&[Key::NewLine, Key::EofOrDelete]); |
| 564 | } |
| 565 | block_on(run_repl_loop(&mut machine, console, program)).unwrap(); |
| 566 | tester.run("").expect_prints([" 123", "End of input by CTRL-D"]).check(); |
| 567 | } |
| 568 | |
| 569 | #[test] |
| 570 | fn test_run_repl_loop_eof_during_input_does_not_exit_repl() { |
nothing calls this directly
no test coverage detected