From 0fa1b61d99618c4a45316dda631127fe3f09d17a Mon Sep 17 00:00:00 2001 From: Herman Skogseth Date: Thu, 16 Oct 2025 15:50:23 +0200 Subject: [PATCH] fix!: Fix typo in `TestContext::elapsed_s` BREAKING CHANGE: Changes the name of a public method on the type `TestContext` from `elapased_s` to `elapsed_s` --- crates/libtest2-harness/src/context.rs | 2 +- crates/libtest2-harness/src/harness.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/libtest2-harness/src/context.rs b/crates/libtest2-harness/src/context.rs index b90a921..7057908 100644 --- a/crates/libtest2-harness/src/context.rs +++ b/crates/libtest2-harness/src/context.rs @@ -33,7 +33,7 @@ impl TestContext { self.notifier().notify(event) } - pub fn elapased_s(&self) -> notify::Elapsed { + pub fn elapsed_s(&self) -> notify::Elapsed { notify::Elapsed(self.start.elapsed()) } diff --git a/crates/libtest2-harness/src/harness.rs b/crates/libtest2-harness/src/harness.rs index 18555d0..cbbbd48 100644 --- a/crates/libtest2-harness/src/harness.rs +++ b/crates/libtest2-harness/src/harness.rs @@ -438,7 +438,7 @@ fn run_case(case: &dyn Case, context: &TestContext) -> std::io::Result { context.notifier().notify( notify::event::CaseStart { name: case.name().to_owned(), - elapsed_s: Some(context.elapased_s()), + elapsed_s: Some(context.elapsed_s()), } .into(), )?; @@ -472,7 +472,7 @@ fn run_case(case: &dyn Case, context: &TestContext) -> std::io::Result { name: case.name().to_owned(), kind, message, - elapsed_s: Some(context.elapased_s()), + elapsed_s: Some(context.elapsed_s()), } .into(), )?; @@ -481,7 +481,7 @@ fn run_case(case: &dyn Case, context: &TestContext) -> std::io::Result { context.notifier().notify( notify::event::CaseComplete { name: case.name().to_owned(), - elapsed_s: Some(context.elapased_s()), + elapsed_s: Some(context.elapsed_s()), } .into(), )?;