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

Function do_error_test_no_reset

core/src/parser.rs:2121–2130  ·  view source on GitHub ↗

Runs the parser on the given `input` and expects the `err` error message. Does not expect the parser to be reset to the next (EOF) statement. TODO(jmmv): Need better testing to ensure the parser is reset to something that can be parsed next.

(input: &str, expected_err: &str)

Source from the content-addressed store, hash-verified

2119 // TODO(jmmv): Need better testing to ensure the parser is reset to something that can be
2120 // parsed next.
2121 fn do_error_test_no_reset(input: &str, expected_err: &str) {
2122 let mut input = input.as_bytes();
2123 for result in parse(&mut input) {
2124 if let Err(e) = result {
2125 assert_eq!(expected_err, format!("{}", e));
2126 return;
2127 }
2128 }
2129 panic!("Parsing did not fail")
2130 }
2131
2132 #[test]
2133 fn test_empty() {

Callers 1

test_if_errorsFunction · 0.85

Calls 2

parseFunction · 0.85
as_bytesMethod · 0.80

Tested by 1

test_if_errorsFunction · 0.68