From aef288c3906d5d60caea51a15feb08daa13d9606 Mon Sep 17 00:00:00 2001 From: Finomnis Date: Sat, 21 Oct 2023 01:30:55 +0200 Subject: [PATCH 1/2] Fix codecov badge url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1a0d33..aa16cf1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![License](https://img.shields.io/crates/l/tokio-graceful-shutdown)](https://github.com/Finomnis/tokio-graceful-shutdown/blob/main/LICENSE-MIT) [![Build Status](https://img.shields.io/github/actions/workflow/status/Finomnis/tokio-graceful-shutdown/ci.yml?branch=main)](https://github.com/Finomnis/tokio-graceful-shutdown/actions/workflows/ci.yml?query=branch%3Amain) [![docs.rs](https://img.shields.io/docsrs/tokio-graceful-shutdown)](https://docs.rs/tokio-graceful-shutdown) -[![Coverage Status](https://img.shields.io/codecov/c/github/Finomnis/tokio-graceful-shutdown)](https://app.codecov.io/github/Finomnis/tokio-graceful-shutdown/tree/main) +[![Coverage Status](https://img.shields.io/codecov/c/github/Finomnis/tokio-graceful-shutdown)](https://app.codecov.io/github/Finomnis/tokio-graceful-shutdown) This crate provides utility functions to perform a graceful shutdown on tokio-rs based services. From b43de104c5fbb1e5d3d2a63e598bd0eeff7373f2 Mon Sep 17 00:00:00 2001 From: Finomnis Date: Sat, 21 Oct 2023 01:41:51 +0200 Subject: [PATCH 2/2] Fix coverage of error_action --- src/error_action.rs | 3 +++ src/error_action/tests.rs | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/error_action/tests.rs diff --git a/src/error_action.rs b/src/error_action.rs index 5155087..d02b27c 100644 --- a/src/error_action.rs +++ b/src/error_action.rs @@ -24,3 +24,6 @@ pub enum ErrorAction { /// Do not forward the error to the parent subsystem. CatchAndLocalShutdown, } + +#[cfg(test)] +mod tests; diff --git a/src/error_action/tests.rs b/src/error_action/tests.rs new file mode 100644 index 0000000..90c84d7 --- /dev/null +++ b/src/error_action/tests.rs @@ -0,0 +1,12 @@ +//Clone, Copy, Debug, Eq, PartialEq + +use super::*; + +#[test] +fn derives() { + let a = ErrorAction::Forward; + let b = ErrorAction::CatchAndLocalShutdown; + + assert_ne!(a, b.clone()); + assert_ne!(format!("{:?}", a), format!("{:?}", b)); +}