Runs the parser on the given `input` and expects the returned statements to match `exp_statements`.
(input: &str, exp_statements: &[Statement])
| 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) { |