about summary refs log tree commit diff
path: root/tvix/eval/src/chunk.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/chunk.rs')
-rw-r--r--tvix/eval/src/chunk.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tvix/eval/src/chunk.rs b/tvix/eval/src/chunk.rs
index 052bf0bf69de..552a4bf6b6d4 100644
--- a/tvix/eval/src/chunk.rs
+++ b/tvix/eval/src/chunk.rs
@@ -154,3 +154,17 @@ impl Chunk {
         Ok(())
     }
 }
+
+#[cfg(test)]
+mod tests {
+    use crate::test_utils::dummy_span;
+
+    use super::*;
+
+    #[test]
+    fn push_op() {
+        let mut chunk = Chunk::default();
+        chunk.push_op(OpCode::OpNull, dummy_span());
+        assert_eq!(chunk.code.last().unwrap(), &OpCode::OpNull);
+    }
+}