@@ -10,8 +10,8 @@ use indexmap::IndexMap;
1010use tokio:: time:: Duration ;
1111use tracing:: Level ;
1212
13- use crate :: { Config , for_pairs, LinksIter , Result , Rt , ToIpAddr , ToIpAddrs , TRACING_TARGET , World } ;
1413use crate :: host:: HostTimer ;
14+ use crate :: { for_pairs, Config , LinksIter , Result , Rt , ToIpAddr , ToIpAddrs , World , TRACING_TARGET } ;
1515
1616/// A handle for interacting with the simulation.
1717pub struct Sim < ' a > {
@@ -430,17 +430,16 @@ impl<'a> Sim<'a> {
430430#[ cfg( test) ]
431431mod test {
432432 use rand:: Rng ;
433+ use std:: future;
433434 use std:: {
434435 net:: { IpAddr , Ipv4Addr } ,
435436 rc:: Rc ,
436437 sync:: {
437- Mutex ,
438- Arc ,
439438 atomic:: { AtomicU64 , Ordering } ,
439+ Arc , Mutex ,
440440 } ,
441441 time:: Duration ,
442442 } ;
443- use std:: future;
444443
445444 use tokio:: {
446445 io:: { AsyncReadExt , AsyncWriteExt } ,
@@ -450,9 +449,9 @@ mod test {
450449
451450 use crate :: net:: UdpSocket ;
452451 use crate :: {
453- Builder , elapsed ,
454- hold ,
455- net :: { TcpListener , TcpStream } , Result , Sim , sim_elapsed , World ,
452+ elapsed , hold ,
453+ net :: { TcpListener , TcpStream } ,
454+ sim_elapsed , Builder , Result , Sim , World ,
456455 } ;
457456
458457 #[ test]
@@ -686,7 +685,6 @@ mod test {
686685 Ok ( ( ) )
687686 }
688687
689-
690688 struct Expectation {
691689 expect_a_receive : bool ,
692690 expect_b_receive : bool ,
@@ -848,41 +846,19 @@ mod test {
848846 Ok ( ( ) )
849847 }
850848
851- run_with_actions ( & [
852- Action :: PartitionOnewayAB ,
853- ] ) ?;
854- run_with_actions ( & [
855- Action :: PartitionOnewayBA ,
856- ] ) ?;
849+ run_with_actions ( & [ Action :: PartitionOnewayAB ] ) ?;
850+ run_with_actions ( & [ Action :: PartitionOnewayBA ] ) ?;
851+ run_with_actions ( & [ Action :: Partition , Action :: RepairOnewayAB ] ) ?;
852+ run_with_actions ( & [ Action :: Partition , Action :: RepairOnewayBA ] ) ?;
853+ run_with_actions ( & [ Action :: PartitionOnewayAB , Action :: Repair ] ) ?;
854+ run_with_actions ( & [ Action :: PartitionOnewayBA , Action :: Repair ] ) ?;
855+ run_with_actions ( & [ Action :: PartitionOnewayBA , Action :: RepairOnewayAB ] ) ?;
856+ run_with_actions ( & [ Action :: PartitionOnewayAB , Action :: PartitionOnewayBA ] ) ?;
857857 run_with_actions ( & [
858858 Action :: Partition ,
859859 Action :: RepairOnewayAB ,
860- ] ) ?;
861- run_with_actions ( & [
862- Action :: Partition ,
863860 Action :: RepairOnewayBA ,
864861 ] ) ?;
865- run_with_actions ( & [
866- Action :: PartitionOnewayAB ,
867- Action :: Repair ,
868- ] ) ?;
869- run_with_actions ( & [
870- Action :: PartitionOnewayBA ,
871- Action :: Repair ,
872- ] ) ?;
873- run_with_actions ( & [
874- Action :: PartitionOnewayBA ,
875- Action :: RepairOnewayAB ,
876- ] ) ?;
877- run_with_actions ( & [
878- Action :: PartitionOnewayAB ,
879- Action :: PartitionOnewayBA ,
880- ] ) ?;
881- run_with_actions ( & [
882- Action :: Partition ,
883- Action :: RepairOnewayAB ,
884- Action :: RepairOnewayBA
885- ] ) ?;
886862
887863 Ok ( ( ) )
888864 }
0 commit comments