Runs the parser on the given `input` and expects the `err` error message.
(input: &str, expected_err: &str)
| 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 | /// |