about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/tests.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-10-20T12·31+0200
committertazjin <mail@tazj.in>2021-10-20T12·50+0000
commitbdde287d226f4a502c58917dd1ea99d7a331749a (patch)
treec2bb78bf14a84085be6ff16b528bffb12c7de124 /users/tazjin/rlox/src/bytecode/tests.rs
parent050a2b473c48b87994e56ade381afbfc2bca4de3 (diff)
refactor(tazjin/rlox): Remove use of sentinel values r/2981
The C code from which this is translated uses sentinel values for
various things, this commit replaces them with standard Rust types
instead (amongst a bunch of other small improvements).

Change-Id: I892811a7afebb5a0f3b825824fc493ab0b399e44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3735
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/tests.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/tests.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/users/tazjin/rlox/src/bytecode/tests.rs b/users/tazjin/rlox/src/bytecode/tests.rs
index de482275ecfd..bc7d6cb878f8 100644
--- a/users/tazjin/rlox/src/bytecode/tests.rs
+++ b/users/tazjin/rlox/src/bytecode/tests.rs
@@ -138,12 +138,14 @@ fn local_variables() {
         r#"
           var a = 10;
           var b = 5;
-
+          var result = 0;
           {
             var b = 10;
             var c = 2;
-            a * b * c;
+            result = a * b * c;
           }
+
+          result;
         "#,
         200.0,
     );