File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -647,6 +647,27 @@ mod tests {
647647 assert_eq ! ( item. status, "active" ) ;
648648 }
649649
650+ #[ test]
651+ fn admin_pool_list_item_saturates_used_size_when_current_exceeds_total ( ) {
652+ let pool = PoolStatus {
653+ id : 0 ,
654+ cmd_line : "pool-0" . to_string ( ) ,
655+ last_update : OffsetDateTime :: UNIX_EPOCH ,
656+ decommission : Some ( PoolDecommissionInfo {
657+ total_size : 100 ,
658+ current_size : 150 ,
659+ ..Default :: default ( )
660+ } ) ,
661+ } ;
662+
663+ let item = DefaultAdminUsecase :: pool_list_item_from_status ( pool) ;
664+
665+ assert_eq ! ( item. total_size, 100 ) ;
666+ assert_eq ! ( item. current_size, 150 ) ;
667+ assert_eq ! ( item. used_size, 0 ) ;
668+ assert_eq ! ( item. used, 0.0 ) ;
669+ }
670+
650671 #[ test]
651672 fn admin_pool_list_item_maps_running_decommission_status ( ) {
652673 let pool = PoolStatus {
You can’t perform that action at this time.
0 commit comments