Add VM test
This commit is contained in:
parent
8043e24637
commit
5f186ade41
@ -1430,6 +1430,13 @@ mod tests {
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn dereference_deep_copy() {
|
||||
let source = "let mut x = 42; let mut y = *x; y += 1; x";
|
||||
|
||||
assert_eq!(run(source), Ok(Some(Value::integer(42))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dereference_variable() {
|
||||
let source = "let x = 42; let y = x; *y";
|
||||
|
Loading…
Reference in New Issue
Block a user