Fix bug in blob's.

This commit is contained in:
Stephen Chung
2021-12-07 19:03:04 +08:00
parent 5df2628eec
commit 4421f33b2c
4 changed files with 15 additions and 12 deletions

View File

@@ -63,6 +63,14 @@ fn test_blobs() -> Result<(), Box<EvalAltResult>> {
engine.eval_with_scope::<Blob>(&mut orig_scope.clone(), "x + x")?,
[1, 2, 3, 1, 2, 3]
);
assert_eq!(
engine.eval_with_scope::<Blob>(&mut orig_scope.clone(), "x += 999; x")?,
[1, 2, 3, 0xe7]
);
assert_eq!(
engine.eval_with_scope::<Blob>(&mut orig_scope.clone(), "x[2] = 999; x")?,
[1, 2, 0xe7]
);
Ok(())
}