mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add test to assert that servo panics when the length of a given data is zero.
This commit is contained in:
parent
e1092b8b1d
commit
b7510bd89f
1 changed files with 8 additions and 0 deletions
|
@ -44,3 +44,11 @@ fn time_profiler_unsorted_stats_test() {
|
||||||
let unsorted_data = vec![5.0, 7.5, 1.0, 8.9];
|
let unsorted_data = vec![5.0, 7.5, 1.0, 8.9];
|
||||||
time::Profiler::get_statistics(&unsorted_data);
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue