aboutsummaryrefslogtreecommitdiff
path: root/tests/criterion_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/criterion_tests.rs')
-rwxr-xr-xtests/criterion_tests.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/criterion_tests.rs b/tests/criterion_tests.rs
index 562eec9..cca448e 100755
--- a/tests/criterion_tests.rs
+++ b/tests/criterion_tests.rs
@@ -1,3 +1,5 @@
+#![allow(deprecated)]
+
use criterion;
use serde_json;
@@ -485,6 +487,15 @@ fn test_benchmark_group_without_input() {
group.finish();
}
+#[test]
+fn test_criterion_doesnt_panic_if_measured_time_is_zero() {
+ let dir = temp_dir();
+ let mut c = short_benchmark(&dir);
+ c.bench_function("zero_time", |bencher| {
+ bencher.iter_custom(|_iters| Duration::new(0, 0))
+ });
+}
+
mod macros {
use super::{criterion, criterion_group, criterion_main};