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

Function test_sdl_console_clear

sdl/src/console.rs:605–634  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

603
604 #[test]
605 fn test_sdl_console_clear() {
606 let mut test = SdlTest::default();
607
608 test.console().print("Before clearing the console").unwrap();
609 test.console().set_color(None, Some(4)).unwrap();
610 test.console().clear(ClearType::All).unwrap();
611 test.console().print("After clearing the console in blue").unwrap();
612
613 test.console().write("A line that will be erased").unwrap();
614 test.console().clear(ClearType::CurrentLine).unwrap();
615
616 test.console().write("A line with corrections1.").unwrap();
617 test.console().clear(ClearType::PreviousChar).unwrap();
618 test.console().clear(ClearType::PreviousChar).unwrap();
619 test.console().print("!").unwrap();
620
621 test.console().write("Remove part of this").unwrap();
622 test.console().move_within_line(-8).unwrap();
623 test.console().clear(ClearType::UntilNewLine).unwrap();
624 test.console().write(" -- done").unwrap();
625
626 test.console().locate(CharsXY { x: 0, y: 5 }).unwrap();
627 test.console().hide_cursor().unwrap();
628 test.console().write("Trailing period should be gone.").unwrap();
629 test.console().clear(ClearType::PreviousChar).unwrap();
630 test.console().move_within_line(-2).unwrap();
631 test.console().show_cursor().unwrap();
632
633 test.verify("sdl/src", "sdl-clear");
634 }
635
636 #[test]
637 fn test_sdl_console_move_cursor() {

Callers

nothing calls this directly

Calls 10

consoleMethod · 0.80
verifyMethod · 0.80
printMethod · 0.45
set_colorMethod · 0.45
clearMethod · 0.45
writeMethod · 0.45
move_within_lineMethod · 0.45
locateMethod · 0.45
hide_cursorMethod · 0.45
show_cursorMethod · 0.45

Tested by

no test coverage detected