From 1253653203c6c21639bf8f6a415aaab7bc366157 Mon Sep 17 00:00:00 2001 From: Ross Andrews Date: Fri, 3 May 2024 23:45:59 -0500 Subject: [PATCH] Test for peek / poke --- vtest/src/forge_tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vtest/src/forge_tests.rs b/vtest/src/forge_tests.rs index c742116..a1c63a4 100644 --- a/vtest/src/forge_tests.rs +++ b/vtest/src/forge_tests.rs @@ -146,6 +146,19 @@ fn global_test() { ) } +#[test] +fn peekpoke_test() { + // Poke a byte in, peek it back out. Peek / poke only touches one byte at a time + assert_eq!( + main_return( + "fn main() { + poke(0x10000, 0x1010); + return peek(0x10000); + }"), + 0x10 + ) +} + #[test] fn static_test() { // Because the static(1) returns the same address each time, a[0] is the same variable