From 221d3b9485a1d84fc4d9f06d864242d3c393d0ba Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 18 Sep 2022 12:38:53 -0400 Subject: test(tvix/eval): Add proof-of-concept test for Chunk 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 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/chunk.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tvix/eval/src/chunk.rs') 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); + } +} -- cgit 1.4.1