diff options
author | Jeena Lee <ijeenalee@gmail.com> | 2016-07-07 13:14:35 -0700 |
---|---|---|
committer | Jeena Lee <ijeenalee@gmail.com> | 2016-07-07 13:14:35 -0700 |
commit | b7510bd89f54f0ccb9040f41d911be2aa30f46f0 (patch) | |
tree | d068ffe15b4f21be5f52335a198d5e0d22eef40c | |
parent | e1092b8b1da4c7c9c778457b0b06c6fa82058078 (diff) | |
download | servo-b7510bd89f54f0ccb9040f41d911be2aa30f46f0.tar.gz servo-b7510bd89f54f0ccb9040f41d911be2aa30f46f0.zip |
Add test to assert that servo panics when the length of a given data is zero.
-rw-r--r-- | tests/unit/profile/time.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/profile/time.rs b/tests/unit/profile/time.rs index 9bae5801262..911f1cf95c0 100644 --- a/tests/unit/profile/time.rs +++ b/tests/unit/profile/time.rs @@ -44,3 +44,11 @@ fn time_profiler_unsorted_stats_test() { let unsorted_data = vec![5.0, 7.5, 1.0, 8.9]; time::Profiler::get_statistics(&unsorted_data); } + +#[cfg(debug_assertions)] +#[test] +#[should_panic] +fn time_profiler_data_len_zero() { + let zero_data = vec![]; + time::Profiler::get_statistics(&zero_data); +} |