Skip to content

Commit

Permalink
Fix build_two
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Sep 25, 2024
1 parent 08c49e6 commit 2b0103a
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions neqo-transport/src/packet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1181,21 +1181,20 @@ mod tests {
builder.encode(&[0; 3]);
let encoder = builder.build(&mut prot).expect("build");
assert_eq!(encoder.len(), 45);
// TODO
// let first = encoder.clone();

// // TODO: 0 ideal here?
// let mut builder =
// PacketBuilder::short(encoder, false, Some(ConnectionId::from(SERVER_CID)), 0);
// builder.pn(1, 3);
// builder.encode(&[0]); // Minimal size (packet number is big enough).
// let encoder = builder.build(&mut prot).expect("build");
// assert_eq!(
// first.as_ref(),
// &encoder.as_ref()[..first.len()],
// "the first packet should be a prefix"
// );
// assert_eq!(encoder.len(), 45 + 29);
let first = encoder.to_vec();

// TODO: 0 ideal here?
let mut builder =
PacketBuilder::short(encoder, false, Some(ConnectionId::from(SERVER_CID)), 0);
builder.pn(1, 3);
builder.encode(&[0]); // Minimal size (packet number is big enough).
let encoder = builder.build(&mut prot).expect("build");
assert_eq!(
first.as_slice(),
&encoder.as_ref()[..first.len()],
"the first packet should be a prefix"
);
assert_eq!(encoder.len(), 45 + 29);
}

#[test]
Expand Down

0 comments on commit 2b0103a

Please sign in to comment.