Better handling of errors during function calls.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#![cfg(not(feature = "no_function"))]
|
||||
use rhai::{Engine, EvalAltResult, Func, ParseErrorType, Scope, INT};
|
||||
use rhai::{Engine, EvalAltResult, INT};
|
||||
|
||||
#[test]
|
||||
fn test_functions() -> Result<(), Box<EvalAltResult>> {
|
||||
|
@@ -41,7 +41,7 @@ fn test_method_call() -> Result<(), Box<EvalAltResult>> {
|
||||
|
||||
#[test]
|
||||
fn test_method_call_style() -> Result<(), Box<EvalAltResult>> {
|
||||
let mut engine = Engine::new();
|
||||
let engine = Engine::new();
|
||||
|
||||
assert_eq!(engine.eval::<INT>("let x = -123; x.abs(); x")?, -123);
|
||||
|
||||
|
@@ -23,7 +23,8 @@ fn test_stack_overflow() -> Result<(), Box<EvalAltResult>> {
|
||||
) {
|
||||
Ok(_) => panic!("should be stack overflow"),
|
||||
Err(err) => match *err {
|
||||
EvalAltResult::ErrorStackOverflow(_) => (),
|
||||
EvalAltResult::ErrorInFunctionCall(name, _, _)
|
||||
if name.starts_with("foo > foo > foo") => {}
|
||||
_ => panic!("should be stack overflow"),
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user