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)
| 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() { |