From 1adc094383c58a844f5ee70e5de5b0fe327f2fc5 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 20 Aug 2022 22:19:29 +0800 Subject: [PATCH] Fix tests. --- tests/custom_syntax.rs | 10 +++++----- tests/debugging.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/custom_syntax.rs b/tests/custom_syntax.rs index cb82491b..0f7992f4 100644 --- a/tests/custom_syntax.rs +++ b/tests/custom_syntax.rs @@ -193,7 +193,7 @@ fn test_custom_syntax() -> Result<(), Box> { // The first symbol must be an identifier assert_eq!( *engine - .register_custom_syntax(&["!"], false, |_, _| Ok(Dynamic::UNIT)) + .register_custom_syntax(["!"], false, |_, _| Ok(Dynamic::UNIT)) .expect_err("should error") .err_type(), ParseErrorType::BadInput(LexError::ImproperSymbol( @@ -204,9 +204,9 @@ fn test_custom_syntax() -> Result<(), Box> { // Check self-termination engine - .register_custom_syntax(&["test1", "$block$"], true, |_, _| Ok(Dynamic::UNIT))? - .register_custom_syntax(&["test2", "}"], true, |_, _| Ok(Dynamic::UNIT))? - .register_custom_syntax(&["test3", ";"], true, |_, _| Ok(Dynamic::UNIT))?; + .register_custom_syntax(["test1", "$block$"], true, |_, _| Ok(Dynamic::UNIT))? + .register_custom_syntax(["test2", "}"], true, |_, _| Ok(Dynamic::UNIT))? + .register_custom_syntax(["test3", ";"], true, |_, _| Ok(Dynamic::UNIT))?; assert_eq!(engine.eval::("test1 { x = y + z; } 42")?, 42); assert_eq!(engine.eval::("test2 } 42")?, 42); @@ -214,7 +214,7 @@ fn test_custom_syntax() -> Result<(), Box> { // Register the custom syntax: var x = ??? engine.register_custom_syntax( - &["var", "$ident$", "=", "$expr$"], + ["var", "$ident$", "=", "$expr$"], true, |context, inputs| { let var_name = inputs[0].get_string_value().unwrap(); diff --git a/tests/debugging.rs b/tests/debugging.rs index 48f8d946..a35d41fc 100644 --- a/tests/debugging.rs +++ b/tests/debugging.rs @@ -12,7 +12,7 @@ fn test_debugging() -> Result<(), Box> { let mut engine = Engine::new(); engine.register_debugger( - || Dynamic::UNIT, + |_| Dynamic::UNIT, |_, _, _, _, _| Ok(rhai::debugger::DebuggerCommand::Continue), ); @@ -47,7 +47,7 @@ fn test_debugger_state() -> Result<(), Box> { let mut engine = Engine::new(); engine.register_debugger( - || { + |_| { // Say, use an object map for the debugger state let mut state = Map::new(); // Initialize properties