Improve type display in error messages.
This commit is contained in:
@@ -10,6 +10,21 @@ fn test_mismatched_op() {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mismatched_op_name() {
|
||||
let engine = Engine::new();
|
||||
|
||||
assert!(matches!(
|
||||
*engine.eval::<String>("true").expect_err("expects error"),
|
||||
EvalAltResult::ErrorMismatchOutputType(need, actual, ..) if need == "string" && actual == "bool"
|
||||
));
|
||||
|
||||
assert!(matches!(
|
||||
*engine.eval::<&str>("true").expect_err("expects error"),
|
||||
EvalAltResult::ErrorMismatchOutputType(need, actual, ..) if need == "&str" && actual == "bool"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "no_object"))]
|
||||
fn test_mismatched_op_custom_type() -> Result<(), Box<EvalAltResult>> {
|
||||
|
Reference in New Issue
Block a user