test: use prop_assert* macros where appropriate
The prop_assert* macros clean-up the assertion output by eliminating the extra panics while it’s reducing inputs. Signed-off-by: Stephen Waits <steve@waits.net>
This commit is contained in:
1 parent
66be2bf6c6
commit
88c762a870
3 files changed
+61
-31
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// This is just for basic interface and happy path testing. It doesn't do anything other than make
|
||||
// sure the expected public interface exists and works.
|
||||
|
||||
use array_init::array_init;
|
||||
use core::time::Duration;
|
||||
use vivaldi_nc::NetworkCoordinate;
|
||||
|
||||
const NUM_NODES: usize = 100;
|
||||
|
||||
#[test]
|
||||
fn basic_usage() {
|
||||
let mut nc: [NetworkCoordinate<2>; NUM_NODES] = array_init(|_| NetworkCoordinate::<2>::new());
|
||||
for i in 0..NUM_NODES {
|
||||
for j in 0..NUM_NODES {
|
||||
if i == j {
|
||||
continue;
|
||||
}
|
||||
let other = nc[j].clone();
|
||||
nc[i].update(&other, Duration::from_millis(100));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user