unit testing for vga

This commit is contained in:
clizia 2025-08-31 20:22:13 +02:00
parent e009cd22a8
commit 386522208e

View file

@ -155,3 +155,28 @@ impl Writer {
}
}
#[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 = "loss and gain is the same";
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_carachter), c);
}
}