diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-02-17 20:46:34 +0100 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-02-17 20:46:34 +0100 |
| commit | a84b687bef49387cb622a81e27f9043fc1e5ee96 (patch) | |
| tree | 5a57b4d93a4b46cd2d4ccbca8c5ae449c64ea766 | |
| parent | ccf07c7bbd08ee33232b493672fdd7ba5f1db5f3 (diff) | |
added tests
| -rw-r--r-- | StrixKernel/src/vga_buffer.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/StrixKernel/src/vga_buffer.rs b/StrixKernel/src/vga_buffer.rs index e2e388a..0f3e22f 100644 --- a/StrixKernel/src/vga_buffer.rs +++ b/StrixKernel/src/vga_buffer.rs @@ -168,4 +168,26 @@ macro_rules! println { pub fn _print(args: fmt::Arguments) { use core::fmt::Write; WRITER.lock().write_fmt(args).unwrap(); +} + +#[test_case] +fn test_println_simple() { + println!("test_println_simple output"); +} + +#[test_case] +fn test_println_many() { + for _ in 0..200 { + println!("test_println_many output"); + } +} + +#[test_case] +fn test_println_output() { + let s = "Some test string that fits on a single line"; + println!("{}", s); + for (i, c) in s.chars().enumerate() { + let screen_char = WRITER.lock().buffer.chars[BUFFER_HEIGHT - 2][i].read(); + assert_eq!(char::from(screen_char.ascii_character), c); + } }
\ No newline at end of file |
