From 5f186ade412be02b3df3d2a4aa0c8f841103286f Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 28 Aug 2024 12:18:27 -0400 Subject: [PATCH] Add VM test --- dust-lang/src/vm.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dust-lang/src/vm.rs b/dust-lang/src/vm.rs index c70b8ab..a84f199 100644 --- a/dust-lang/src/vm.rs +++ b/dust-lang/src/vm.rs @@ -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";