Add ParseError:err_type and ParseError::position.

This commit is contained in:
Stephen Chung
2022-07-29 09:42:30 +08:00
parent 6fab9f5b63
commit ea38185cac
19 changed files with 147 additions and 104 deletions

View File

@@ -167,10 +167,10 @@ fn test_eval_disabled() -> Result<(), Box<EvalAltResult>> {
engine.disable_symbol("eval");
assert!(matches!(
*engine
engine
.compile(r#"eval("40 + 2")"#)
.expect_err("should error")
.0,
.err_type(),
ParseErrorType::BadInput(LexError::ImproperSymbol(err, ..)) if err == "eval"
));