Add more tests for println
This commit is contained in:
parent
cd685e79c7
commit
7cac67b0fc
@ -168,3 +168,22 @@ lazy_static! {
|
||||
fn test_println_simple() {
|
||||
println!("Does this work?");
|
||||
}
|
||||
|
||||
#[test_case]
|
||||
fn test_println_many() {
|
||||
for _ in 0..200 {
|
||||
println!("Test many output");
|
||||
}
|
||||
}
|
||||
|
||||
#[test_case]
|
||||
fn test_println_output() {
|
||||
let s = "Test string that fits on a single line";
|
||||
println!("{}", s);
|
||||
for (i, c) in s.chars().enumerate() {
|
||||
let screen_char_ptr =
|
||||
&WRITER.lock().buffer.chars[BUFFER_HEIGHT - 2][i] as *const ScreenChar;
|
||||
let screen_char = unsafe { core::ptr::read_volatile(screen_char_ptr) };
|
||||
assert_eq!(char::from(screen_char.ascii_char), c);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user