| 173 | // verify that the printed lines really appear on the screen |
| 174 | #[test_case] |
| 175 | fn 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 | } |