Fix tests.

This commit is contained in:
Stephen Chung 2022-08-05 23:45:40 +08:00
parent d8532b48b6
commit d9ffac17fa
3 changed files with 4 additions and 7 deletions

View File

@ -201,7 +201,7 @@ impl<'e> ParseState<'e> {
} else {
NonZeroUsize::new(index)
};
(index, is_func)
}

View File

@ -1,9 +1,7 @@
//! Implement deserialization support of [`Dynamic`][crate::Dynamic] for [`serde`].
use crate::types::dynamic::Union;
use crate::{
Dynamic, ImmutableString, LexError, Position, RhaiError, RhaiResultOf, SmartString, ERR,
};
use crate::{Dynamic, ImmutableString, LexError, Position, RhaiError, RhaiResultOf, ERR};
use serde::de::{Error, IntoDeserializer, Visitor};
use serde::{Deserialize, Deserializer};
#[cfg(feature = "no_std")]
@ -422,7 +420,7 @@ impl<'de> Deserializer<'de> for &mut DynamicDeserializer<'de> {
|| self.type_error(),
|map| {
_visitor.visit_map(IterateMap::new(
map.keys().map(SmartString::as_str),
map.keys().map(crate::SmartString::as_str),
map.values(),
))
},

View File

@ -105,8 +105,7 @@ fn test_options_strict_var() -> Result<(), Box<EvalAltResult>> {
#[cfg(not(feature = "no_function"))]
{
assert_eq!(
engine
.eval_with_scope::<INT>(&mut scope, "fn foo(z) { y + z } let f = foo; f.call(x)")?,
engine.eval_with_scope::<INT>(&mut scope, "fn foo(z) { z } let f = foo; call(f, x)")?,
42
);
assert!(engine.compile("let f = |y| x * y;").is_err());