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

Method expect_err

std/src/console/readline.rs:642–657  ·  view source on GitHub ↗

Executes the test and expects the given error kind.

(mut self, exp_kind: io::ErrorKind)

Source from the content-addressed store, hash-verified

640
641 /// Executes the test and expects the given error kind.
642 fn expect_err(mut self, exp_kind: io::ErrorKind) {
643 let mut console = MockConsole::default();
644 console.add_input_keys(&self.keys);
645 console.set_size_chars(self.size_chars);
646 let err = block_on(read_line_interactive(
647 &mut console,
648 self.prompt,
649 self.previous,
650 self.history.as_mut(),
651 self.echo,
652 ))
653 .expect_err("read_line_interactive should fail");
654 assert_eq!(exp_kind, err.kind());
655 assert_eq!(self.exp_output.as_slice(), console.captured_out());
656 assert_eq!(self.exp_history, self.history);
657 }
658 }
659
660 #[test]

Calls 3

read_line_interactiveFunction · 0.85
add_input_keysMethod · 0.80
set_size_charsMethod · 0.45