From 5b445add4bf0be1e34418d8496cdfd6c88689e08 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 15 Sep 2020 10:31:44 -0400 Subject: [PATCH] Fix code coverage --- benches/stock_functions.rs | 3 +-- src/bigint.rs | 2 +- src/lib.rs | 2 +- src/num.rs | 4 ++-- src/rational.rs | 2 +- tests/fractions.rs | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/benches/stock_functions.rs b/benches/stock_functions.rs index c4e7cce..c37235d 100644 --- a/benches/stock_functions.rs +++ b/benches/stock_functions.rs @@ -1,6 +1,5 @@ use criterion::{criterion_group, criterion_main}; - -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod sf { use criterion::{black_box, BenchmarkId, Criterion}; use rusty_numbers::num::Unsigned; diff --git a/src/bigint.rs b/src/bigint.rs index 9145e2e..e8c0a1e 100644 --- a/src/bigint.rs +++ b/src/bigint.rs @@ -600,7 +600,7 @@ impl_from_smaller!((i8, u8), (i16, u16), (i32, u32), (i64, u64)); impl_ord_literal!(i8, u8, i16, u16, i32, u32, i64, u64, i128, u128); #[cfg(test)] -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod tests { use super::*; diff --git a/src/lib.rs b/src/lib.rs index aaa3ccd..bec4bdf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -209,7 +209,7 @@ pub fn approx_factorial(n: f64) -> Option { } #[cfg(test)] -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod tests { use super::*; diff --git a/src/num.rs b/src/num.rs index 9a83a8d..81f90e0 100644 --- a/src/num.rs +++ b/src/num.rs @@ -30,7 +30,7 @@ pub enum FracOp { } impl Default for Sign { - #[cfg_attr(tarpaulin, skip)] + #[cfg(not(tarpaulin_include))] fn default() -> Self { Sign::Positive } @@ -304,7 +304,7 @@ impl_unsigned!(u8, u16, u32, u64, u128, usize); impl_empty!(Signed, (i8, i16, i32, i64, i128, isize)); #[cfg(test)] -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod tests { use super::*; diff --git a/src/rational.rs b/src/rational.rs index a64502c..fac9383 100644 --- a/src/rational.rs +++ b/src/rational.rs @@ -308,7 +308,7 @@ impl Neg for Frac { } #[cfg(test)] -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod tests { use super::*; diff --git a/tests/fractions.rs b/tests/fractions.rs index ff92979..ed44d49 100644 --- a/tests/fractions.rs +++ b/tests/fractions.rs @@ -1,4 +1,4 @@ -#[cfg_attr(tarpaulin, skip)] +#[cfg(not(tarpaulin_include))] mod tests { use rusty_numbers::frac; use rusty_numbers::rational::Frac;