Increase test coverage for generic modules

This commit is contained in:
John Nunley
2023-08-05 08:58:38 -07:00
committed by GitHub
parent 57fad2ce15
commit 8a7e18aaf0
3 changed files with 643 additions and 0 deletions

View File

@@ -109,3 +109,25 @@ impl error::Error for OsError {}
impl error::Error for ExternalError {}
impl error::Error for NotSupportedError {}
impl error::Error for RunLoopError {}
#[cfg(test)]
mod tests {
#![allow(clippy::redundant_clone)]
use super::*;
// Eat attributes for testing
#[test]
fn ensure_fmt_does_not_panic() {
let _ = format!(
"{:?}, {}",
NotSupportedError::new(),
NotSupportedError::new().clone()
);
let _ = format!(
"{:?}, {}",
ExternalError::NotSupported(NotSupportedError::new()),
ExternalError::NotSupported(NotSupportedError::new())
);
}
}