@@ -1248,9 +1248,9 @@ mod tests {
12481248 // Create two separate blocks: 12-13 and 15-16
12491249 observe ( & mut d, now, & [ 12 , 13 , 15 , 16 ] ) ;
12501250 // Now fill the gap between them with 14. This should merge the blocks.
1251- // The current implementation of `add_additional_tsn` is buggy and will
1252- // result in `[12..14, 14..17]`.
12531251 observe ( & mut d, now, & [ 14 ] ) ;
1252+ assert_eq ! ( d. additional_tsn_blocks, vec![ Tsn ( 12 ) ..Tsn ( 17 ) ] ) ;
1253+
12541254 // Now receive 11, which should advance the cumulative ack over all blocks.
12551255 observe ( & mut d, now, & [ 11 ] ) ;
12561256
@@ -1268,21 +1268,22 @@ mod tests {
12681268 // Create two separate blocks: 13 and 15.
12691269 // State: additional_tsn_blocks = [13..14, 15..16]
12701270 observe ( & mut d, now, & [ 13 , 15 ] ) ;
1271+ assert_eq ! ( d. additional_tsn_blocks, vec![ Tsn ( 13 ) ..Tsn ( 14 ) , Tsn ( 15 ) ..Tsn ( 16 ) ] ) ;
1272+
12711273
12721274 // Fill the gap between them with 14.
1273- // This hits a bug in `add_additional_tsn` where expanding a block to the left
1274- // doesn't check if it can merge with the block before it, resulting in adjacent blocks.
1275- // State: additional_tsn_blocks = [13..14, 14..16]
12761275 observe ( & mut d, now, & [ 14 ] ) ;
1276+ assert_eq ! ( d. additional_tsn_blocks, vec![ Tsn ( 13 ) ..Tsn ( 16 ) ] ) ;
12771277
12781278 // Add 12, which expands the first block to the left.
1279- // State: additional_tsn_blocks = [12..14, 14..16]
12801279 observe ( & mut d, now, & [ 12 ] ) ;
1280+ assert_eq ! ( d. additional_tsn_blocks, vec![ Tsn ( 12 ) ..Tsn ( 16 ) ] ) ;
12811281
12821282 // Now receive 11, which should advance the cumulative ack over all blocks.
1283- // But `observe` only processes one block, leaving last_cumulative_acked_tsn
1284- // at 13 instead of 15.
12851283 observe ( & mut d, now, & [ 11 ] ) ;
1284+ assert_eq ! ( d. last_cumulative_acked_tsn, Tsn ( 15 ) ) ;
1285+ assert_eq ! ( d. additional_tsn_blocks, vec![ ] ) ;
1286+
12861287
12871288 let sack = d. create_selective_ack ( A_RWND ) ;
12881289 assert_eq ! ( sack. cumulative_tsn_ack, Tsn ( 15 ) ) ;
0 commit comments