Use .. for (_).

This commit is contained in:
Stephen Chung
2022-02-08 09:46:14 +08:00
parent 97a8fd3d5b
commit 7686ca619a
24 changed files with 155 additions and 149 deletions

View File

@@ -48,7 +48,7 @@ fn test_closures() -> Result<(), Box<EvalAltResult>> {
.compile_expression("let f = |x| {};")
.expect_err("should error")
.0,
ParseErrorType::BadInput(_)
ParseErrorType::BadInput(..)
));
assert_eq!(

View File

@@ -74,7 +74,7 @@ fn test_fn_ptr() -> Result<(), Box<EvalAltResult>> {
)
.expect_err("should error"),
EvalAltResult::ErrorInFunctionCall(fn_name, _, err, ..)
if fn_name == "foo" && matches!(*err, EvalAltResult::ErrorUnboundThis(_))
if fn_name == "foo" && matches!(*err, EvalAltResult::ErrorUnboundThis(..))
));
Ok(())

View File

@@ -249,7 +249,7 @@ fn test_internal_fn_bang() -> Result<(), Box<EvalAltResult>> {
)
.expect_err("should error")
.0,
ParseErrorType::MalformedCapture(_)
ParseErrorType::MalformedCapture(..)
));
Ok(())

View File

@@ -214,7 +214,7 @@ fn test_module_resolver() -> Result<(), Box<EvalAltResult>> {
"#
)
.expect_err("should error"),
EvalAltResult::ErrorTooManyModules(_)
EvalAltResult::ErrorTooManyModules(..)
));
#[cfg(not(feature = "no_function"))]

View File

@@ -19,7 +19,7 @@ fn test_max_operations() -> Result<(), Box<EvalAltResult>> {
assert!(matches!(
*engine.run("for x in 0..500 {}").expect_err("should error"),
EvalAltResult::ErrorTooManyOperations(_)
EvalAltResult::ErrorTooManyOperations(..)
));
engine.set_max_operations(0);
@@ -44,7 +44,7 @@ fn test_max_operations_literal() -> Result<(), Box<EvalAltResult>> {
*engine
.run("[1, 2, 3, 4, 5, 6, 7, 8, 9]")
.expect_err("should error"),
EvalAltResult::ErrorTooManyOperations(_)
EvalAltResult::ErrorTooManyOperations(..)
));
#[cfg(not(feature = "no_object"))]
@@ -55,7 +55,7 @@ fn test_max_operations_literal() -> Result<(), Box<EvalAltResult>> {
*engine
.run("#{a:1, b:2, c:3, d:4, e:5, f:6, g:7, h:8, i:9}")
.expect_err("should error"),
EvalAltResult::ErrorTooManyOperations(_)
EvalAltResult::ErrorTooManyOperations(..)
));
Ok(())
@@ -111,7 +111,7 @@ fn test_max_operations_functions() -> Result<(), Box<EvalAltResult>> {
"#,
)
.expect_err("should error"),
EvalAltResult::ErrorTooManyOperations(_)
EvalAltResult::ErrorTooManyOperations(..)
));
Ok(())
@@ -138,7 +138,7 @@ fn test_max_operations_eval() -> Result<(), Box<EvalAltResult>> {
"#
)
.expect_err("should error"),
EvalAltResult::ErrorInFunctionCall(.., err, _) if matches!(*err, EvalAltResult::ErrorTooManyOperations(_))
EvalAltResult::ErrorInFunctionCall(.., err, _) if matches!(*err, EvalAltResult::ErrorTooManyOperations(..))
));
Ok(())

View File

@@ -29,7 +29,7 @@ fn test_stack_overflow_fn_calls() -> Result<(), Box<EvalAltResult>> {
max + 1
))
.expect_err("should error"),
EvalAltResult::ErrorStackOverflow(_)
EvalAltResult::ErrorStackOverflow(..)
));
Ok(())