about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/tests.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/tests.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/tests.rs b/users/tazjin/rlox/src/bytecode/tests.rs
index d9a752b38788..d02f021ff0fd 100644
--- a/users/tazjin/rlox/src/bytecode/tests.rs
+++ b/users/tazjin/rlox/src/bytecode/tests.rs
@@ -58,3 +58,12 @@ fn trivial_literals() {
     expect("false", Value::Bool(false));
     expect("nil", Value::Nil);
 }
+
+#[test]
+fn negation() {
+    expect("!true", Value::Bool(false));
+    expect("!false", Value::Bool(true));
+    expect("!nil", Value::Bool(true));
+    expect("!13.5", Value::Bool(false));
+    expect("!-42", Value::Bool(false));
+}