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 <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
bb47baf638
commit
221d3b9485
4 changed files with 28 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue