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

Function do_error_test

core/src/parser.rs:2106–2114  ·  view source on GitHub ↗

Runs the parser on the given `input` and expects the `err` error message.

(input: &str, expected_err: &str)

Source from the content-addressed store, hash-verified

2104
2105 /// Runs the parser on the given `input` and expects the `err` error message.
2106 fn do_error_test(input: &str, expected_err: &str) {
2107 let mut input = input.as_bytes();
2108 let mut parser = Parser::from(&mut input);
2109 assert_eq!(
2110 expected_err,
2111 format!("{}", parser.parse_one_safe().expect_err("Parsing did not fail"))
2112 );
2113 assert!(parser.parse_one_safe().unwrap().is_none());
2114 }
2115
2116 /// Runs the parser on the given `input` and expects the `err` error message.
2117 ///

Callers 15

test_assignment_errorsFunction · 0.85
test_data_errorsFunction · 0.85
test_dim_errorsFunction · 0.85
test_do_errorsFunction · 0.85
test_exit_errorsFunction · 0.85
do_expr_error_testFunction · 0.85
test_if_errorsFunction · 0.85

Calls 1

as_bytesMethod · 0.80

Tested by 15

test_assignment_errorsFunction · 0.68
test_data_errorsFunction · 0.68
test_dim_errorsFunction · 0.68
test_do_errorsFunction · 0.68
test_exit_errorsFunction · 0.68
test_if_errorsFunction · 0.68