File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,7 @@ mod tests {
535
535
struct TestPayload {
536
536
subscription_count : usize ,
537
537
service_count : usize ,
538
+ dynamic_subscription_count : usize ,
538
539
}
539
540
540
541
#[ test]
@@ -549,6 +550,14 @@ mod tests {
549
550
} ,
550
551
) ;
551
552
553
+ let _count_dynamic_sub = worker. create_dynamic_subscription (
554
+ "test_msgs/msg/Empty" . try_into ( ) . unwrap ( ) ,
555
+ "test_worker_topic" ,
556
+ |payload : & mut TestPayload , _, _| {
557
+ payload. dynamic_subscription_count += 1 ;
558
+ } ,
559
+ ) ;
560
+
552
561
let _count_srv = worker. create_service :: < EmptySrv , _ > (
553
562
"test_worker_service" ,
554
563
|payload : & mut TestPayload , _req : Empty_Request | {
@@ -558,7 +567,10 @@ mod tests {
558
567
) ;
559
568
560
569
let promise = worker. listen_until ( move |payload| {
561
- if payload. service_count > 0 && payload. subscription_count > 0 {
570
+ if payload. service_count > 0
571
+ && payload. subscription_count > 0
572
+ && payload. dynamic_subscription_count > 0
573
+ {
562
574
Some ( * payload)
563
575
} else {
564
576
None
You can’t perform that action at this time.
0 commit comments