Add is_shared function.

This commit is contained in:
Stephen Chung
2020-07-31 18:43:34 +08:00
parent 0295e109ad
commit 8d0623d07f
6 changed files with 38 additions and 23 deletions

View File

@@ -18,6 +18,11 @@ fn test_shared() -> Result<(), Box<EvalAltResult>> {
assert_eq!(engine.eval::<char>("shared('x')")?, 'x');
assert!(engine.eval::<bool>("is_shared(shared(42))")?);
#[cfg(not(feature = "no_object"))]
assert!(engine.eval::<bool>("shared(42).is_shared()")?);
#[cfg(not(feature = "no_index"))]
{
assert_eq!(