Add remove/insert to arrays and maps.
This commit is contained in:
@@ -33,6 +33,16 @@ fn test_map_indexing() -> Result<(), EvalAltResult> {
|
||||
assert!(engine.eval::<bool>("let y = #{a: 1, b: 2, c: 3}; 'b' in y")?);
|
||||
assert!(!engine.eval::<bool>(r#"let y = #{a: 1, b: 2, c: 3}; "z" in y"#)?);
|
||||
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
r#"
|
||||
let x = #{a: 1, b: 2, c: 3};
|
||||
let c = x.remove("c");
|
||||
x.len() + c
|
||||
"#
|
||||
)?,
|
||||
5
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
r"
|
||||
|
Reference in New Issue
Block a user