Fix tests.

This commit is contained in:
Stephen Chung 2022-08-09 17:24:24 +08:00
parent d9a58907d9
commit f323644e20
2 changed files with 6 additions and 9 deletions

View File

@ -17,7 +17,7 @@ impl Engine {
/// ///
/// let engine = Engine::new(); /// let engine = Engine::new();
/// ///
/// engine.run::<i64>("print(40 + 2);")?; /// engine.run("print(40 + 2);")?;
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```
@ -49,7 +49,7 @@ impl Engine {
/// engine.run_with_scope(&mut scope, "x += 2; print(x);")?; /// engine.run_with_scope(&mut scope, "x += 2; print(x);")?;
/// ///
/// // The variable in the scope is modified /// // The variable in the scope is modified
/// assert_eq!(scope.get_value::<i64>("x").expect("variable x should exist"), 44); /// assert_eq!(scope.get_value::<i64>("x").expect("variable x should exist"), 42);
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```
@ -105,7 +105,7 @@ impl Engine {
/// engine.run_ast_with_scope(&mut scope, &ast)?; /// engine.run_ast_with_scope(&mut scope, &ast)?;
/// ///
/// // The variable in the scope is modified /// // The variable in the scope is modified
/// assert_eq!(scope.get_value::<i64>("x").expect("variable x should exist"), 44); /// assert_eq!(scope.get_value::<i64>("x").expect("variable x should exist"), 42);
/// # Ok(()) /// # Ok(())
/// # } /// # }
/// ``` /// ```

View File

@ -166,15 +166,12 @@ type ExclusiveRange = std::ops::Range<INT>;
/// An inclusive integer range. /// An inclusive integer range.
type InclusiveRange = std::ops::RangeInclusive<INT>; type InclusiveRange = std::ops::RangeInclusive<INT>;
#[allow(deprecated)]
pub use api::build_type::{CustomType, TypeBuilder};
#[cfg(not(feature = "no_std"))] #[cfg(not(feature = "no_std"))]
#[cfg(not(target_family = "wasm"))] #[cfg(not(target_family = "wasm"))]
pub use api::files::{eval_file, run_file}; pub use api::files::{eval_file, run_file};
pub use api::{ pub use api::{eval::eval, events::VarDefInfo, run::run};
build_type::{CustomType, TypeBuilder},
eval::eval,
events::VarDefInfo,
run::run,
};
pub use ast::{FnAccess, AST}; pub use ast::{FnAccess, AST};
pub use engine::{Engine, OP_CONTAINS, OP_EQUALS}; pub use engine::{Engine, OP_CONTAINS, OP_EQUALS};
pub use eval::EvalContext; pub use eval::EvalContext;