diff options
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/tests.rs')
-rw-r--r-- | users/tazjin/rlox/src/bytecode/tests.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/users/tazjin/rlox/src/bytecode/tests.rs b/users/tazjin/rlox/src/bytecode/tests.rs index 13e64400ade5..de482275ecfd 100644 --- a/users/tazjin/rlox/src/bytecode/tests.rs +++ b/users/tazjin/rlox/src/bytecode/tests.rs @@ -128,6 +128,23 @@ fn global_assignment() { breakfast = "beignets with " + beverage; breakfast; "#, - "beignets with cafe au lait" + "beignets with cafe au lait", + ); +} + +#[test] +fn local_variables() { + expect_num( + r#" + var a = 10; + var b = 5; + + { + var b = 10; + var c = 2; + a * b * c; + } + "#, + 200.0, ); } |