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

Function do_ok_test

core/src/parser.rs:2098–2103  ·  view source on GitHub ↗

Runs the parser on the given `input` and expects the returned statements to match `exp_statements`.

(input: &str, exp_statements: &[Statement])

Source from the content-addressed store, hash-verified

2096 /// Runs the parser on the given `input` and expects the returned statements to match
2097 /// `exp_statements`.
2098 fn do_ok_test(input: &str, exp_statements: &[Statement]) {
2099 let mut input = input.as_bytes();
2100 let statements =
2101 parse(&mut input).map(|r| r.expect("Parsing failed")).collect::<Vec<Statement>>();
2102 assert_eq!(exp_statements, statements.as_slice());
2103 }
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) {

Calls 2

parseFunction · 0.85
as_bytesMethod · 0.80