Remove dependency on more-asserts (#4408)

* Remove dependency on `more-asserts`

In my recent adventures to do a bit of gardening on our dependencies I
noticed that there's a new major version for the `more-asserts` crate.
Instead of updating to this though I've opted to instead remove the
dependency since I don't think we heavily lean on this crate and
otherwise one-off prints are probably sufficient to avoid the need for
pulling in a whole crate for this.

* Remove exemption for `more-asserts`
This commit is contained in:
Alex Crichton
2022-07-26 11:47:33 -05:00
committed by GitHub
parent 1183191d7d
commit 1321c234e5
42 changed files with 125 additions and 227 deletions

View File

@@ -32,6 +32,5 @@ rustix = { version = "0.35.6", features = ["process"] }
[dev-dependencies]
filetime = "0.2.7"
once_cell = "1.12.0"
more-asserts = "0.2.1"
pretty_env_logger = "0.4.0"
tempfile = "3"

View File

@@ -1,6 +1,5 @@
use super::*;
use crate::config::tests::test_prolog;
use more_asserts::{assert_ge, assert_gt, assert_lt};
use std::iter::repeat;
use std::process;
// load_config! comes from crate::cache(::config::tests);
@@ -150,10 +149,7 @@ fn test_on_get_recompress_with_mod_file() {
let scenarios = [(4, false), (7, true), (2, false)];
let mut usages = start_stats.usages;
assert_lt!(
usages,
cache_config.optimized_compression_usage_counter_threshold()
);
assert!(usages < cache_config.optimized_compression_usage_counter_threshold());
let mut tested_higher_opt_compr_lvl = false;
for (times_used, lower_compr_lvl) in &scenarios {
for _ in 0..*times_used {
@@ -180,19 +176,13 @@ fn test_on_get_recompress_with_mod_file() {
assert_eq!(decoded_data, mod_data.as_bytes());
if *lower_compr_lvl {
assert_ge!(
usages,
cache_config.optimized_compression_usage_counter_threshold()
);
assert!(usages >= cache_config.optimized_compression_usage_counter_threshold());
tested_higher_opt_compr_lvl = true;
stats.compression_level -= 1;
assert!(write_stats_file(&stats_file, &stats));
}
}
assert_ge!(
usages,
cache_config.optimized_compression_usage_counter_threshold()
);
assert!(usages >= cache_config.optimized_compression_usage_counter_threshold());
assert!(tested_higher_opt_compr_lvl);
}
@@ -428,7 +418,7 @@ fn test_on_update_cleanup_limits_trash_locks() {
"past",
&Duration::from_secs(secs_ago),
);
assert_gt!(secs_ago, 0);
assert!(secs_ago > 0);
secs_ago -= 1;
}