MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / test_println_output

Function test_println_output

kernel/src/vga_buffer.rs:175–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173// verify that the printed lines really appear on the screen
174#[test_case]
175fn test_println_output() {
176 use core::fmt::Write;
177 use x86_64::instructions::interrupts;
178
179 let s = "Some test string that fits on a single line";
180 interrupts::without_interrupts(|| {
181 let mut writer = WRITER.lock();
182 writeln!(writer, "\n{}", s).expect("writeln failed");
183 for (i, c) in s.chars().enumerate() {
184 let screen_char = writer.buffer.chars[BUFFER_HEIGHT - 2][i].read();
185 assert_eq!(char::from(screen_char.ascii_character), c);
186 }
187 });
188}

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected