tor-circmgr: Test random_idx_where with empty slice
I have verified that this test fails, as expected, when applied without the corresponding bugfix.
This commit is contained in:
parent
a0f5dbc05d
commit
879c540cfa
|
@ -186,4 +186,11 @@ mod test {
|
|||
assert!(found[idx] == (num & 1 == 1));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn random_idx_empty() {
|
||||
let mut rng = testing_rng();
|
||||
let idx = random_idx_where(&mut rng, &[], |_: &i32| panic!());
|
||||
assert_eq!(idx, None);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue