MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_gfx_peek_ok

Function test_gfx_peek_ok

std/src/gfx/mod.rs:1543–1556  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1541
1542 #[test]
1543 fn test_gfx_peek_ok() {
1544 let mut t = Tester::default();
1545 t.get_console().borrow_mut().set_peek_pixel(PixelsXY::new(1, 2), Some(7));
1546 t.run("result = GFX_PEEK(1, 2)").expect_var("result", 7i32).check();
1547
1548 let mut t = Tester::default();
1549 t.get_console().borrow_mut().set_peek_pixel(PixelsXY::new(1, 2), None);
1550 t.run("result = GFX_PEEK(1, 2)").expect_var("result", -1i32).check();
1551
1552 Tester::default()
1553 .run("result = GFX_PEEK(-31000.2, 31999.7)")
1554 .expect_var("result", -1i32)
1555 .check();
1556 }
1557
1558 #[test]
1559 fn test_gfx_peek_errors() {

Callers

nothing calls this directly

Calls 5

set_peek_pixelMethod · 0.80
expect_varMethod · 0.80
get_consoleMethod · 0.45
checkMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected