From 526abb3e5b3175008cb60f78b645d5e2c0f5072a Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Tue, 23 Aug 2022 20:37:23 -0700 Subject: * cargo fmt --- src/tests.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/tests.rs') 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 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::()); - self(); - serial_println!("[ok]"); - } + /// # Default run + /// + /// Run each test and print results to output + fn run(&self) { + serial_print!("{}...\t", core::any::type_name::()); + 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); } -- cgit v1.2.1