diff options
| author | Christian Cunningham <c@localhost> | 2022-08-23 20:37:23 -0700 |
|---|---|---|
| committer | Christian Cunningham <c@localhost> | 2022-08-23 20:37:23 -0700 |
| commit | 526abb3e5b3175008cb60f78b645d5e2c0f5072a (patch) | |
| tree | a125d6358eb847585f7b1a3625eb166c8c96a712 /src/tests.rs | |
| parent | a1c8269dc367a6b37986417aa650ec65ac77aae3 (diff) | |
* cargo fmt
Diffstat (limited to 'src/tests.rs')
| -rw-r--r-- | src/tests.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/tests.rs b/src/tests.rs index 745672a..bcdbed1 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,4 +1,4 @@ -use crate::{serial_print,serial_println}; +use crate::{serial_print, serial_println}; #[cfg(test)] use crate::qemu::*; @@ -7,21 +7,21 @@ use crate::qemu::*; /// /// Trait for test functions pub trait Testable { - fn run(&self) -> (); + fn run(&self) -> (); } impl<T> Testable for T where - T: Fn(), + T: Fn(), { - /// # Default run - /// - /// Run each test and print results to output - fn run(&self) { - serial_print!("{}...\t", core::any::type_name::<T>()); - self(); - serial_println!("[ok]"); - } + /// # Default run + /// + /// Run each test and print results to output + fn run(&self) { + serial_print!("{}...\t", core::any::type_name::<T>()); + self(); + serial_println!("[ok]"); + } } /// # Run tests @@ -29,11 +29,11 @@ where /// Run each of the tests #[cfg(test)] pub fn test_runner(tests: &[&dyn Testable]) { - serial_println!("Running {} tests", tests.len()); - for test in tests { - test.run(); - } - exit_qemu(QemuExitCode::Success); + serial_println!("Running {} tests", tests.len()); + for test in tests { + test.run(); + } + exit_qemu(QemuExitCode::Success); } /// # Trivial test @@ -41,5 +41,5 @@ pub fn test_runner(tests: &[&dyn Testable]) { /// This test ought to succeed no matter what #[test_case] fn trivial_assertion() { - assert_eq!(1, 1); + assert_eq!(1, 1); } |
