Test for peek / poke

This commit is contained in:
2024-05-03 23:45:59 -05:00
parent 4b836d076b
commit 1253653203
+13
View File
@@ -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