Pretty-print common type names.

This commit is contained in:
Stephen Chung
2020-03-02 23:16:19 +08:00
parent a4a9102fc5
commit 366188234b
4 changed files with 38 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ fn test_decrement() -> Result<(), EvalAltResult> {
let r = engine.eval::<String>("let s = \"test\"; s -= \"ing\"; s");
match r {
Err(EvalAltResult::ErrorFunctionNotFound(err, _)) if err.starts_with("- ") => (),
Err(EvalAltResult::ErrorFunctionNotFound(err, _)) if err == "- (string, string)" => (),
_ => panic!(),
}

View File

@@ -7,7 +7,7 @@ fn test_mismatched_op() {
let r = engine.eval::<i64>("60 + \"hello\"");
match r {
Err(EvalAltResult::ErrorMismatchOutputType(err, _)) if err == "alloc::string::String" => (),
Err(EvalAltResult::ErrorMismatchOutputType(err, _)) if err == "string" => (),
_ => panic!(),
}
}