Add test to assert that servo panics when the length of a given data is zero.

This commit is contained in:
Jeena Lee 2016-07-07 13:14:35 -07:00
parent e1092b8b1d
commit b7510bd89f

View file

@ -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);
}