()
| 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() { |
nothing calls this directly
no test coverage detected