about summary refs log tree commit diff
path: root/tvix/eval/src/chunk.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-09-18T16·38-0400
committerclbot <clbot@tvl.fyi>2022-09-18T17·55+0000
commit221d3b9485a1d84fc4d9f06d864242d3c393d0ba (patch)
treee3d909f886e9f57b995f46ca7cc445700d57d39c /tvix/eval/src/chunk.rs
parentbb47baf638c96d133dae51827ff676166d818153 (diff)
test(tvix/eval): Add proof-of-concept test for Chunk r/4901
This is pretty boring at the moment, but mostly serves as a foot in the
door in the direction of writing more tests

Change-Id: Id88eb4ec7e53ebb2d5b5c254c8f45ff750238811
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6637
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
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);
+    }
+}