test: remove unnecessary enumeration

This commit is contained in:
Tyler Beckman 2024-10-26 17:41:49 -06:00
parent 7f9f4fd99b
commit e2f4de8603
Signed by: Ty
GPG key ID: 2813440C772555A4

View file

@ -3,8 +3,8 @@ use std::sync::Arc;
use base64ct::Encoding;
use ct::{
merkle::{
consts::{EXTRA_DATA_BASE64_BUFFER_SIZE, LEAF_BASE64_BUFFER_SIZE},
types::{LogEntryType, MerkleLeafType, Version}
consts::EXTRA_DATA_BASE64_BUFFER_SIZE,
types::{MerkleLeafType, Version}
},
parsing::entry::{parse_entry_extra_data_precert, parse_entry_extra_data_x509}
};
@ -50,7 +50,7 @@ async fn fetch_entries() -> impl Iterator<Item = Entry> {
async fn test_letsencrypt_2024h2_parsing() {
let mut buffer = [0u8; EXTRA_DATA_BASE64_BUFFER_SIZE];
for (i, entry) in fetch_entries().await.enumerate() {
for entry in fetch_entries().await {
// Parse leaf_input
buffer[..entry.leaf_input.len()].copy_from_slice(entry.leaf_input.as_bytes());
let parsed =
@ -90,7 +90,7 @@ async fn test_letsencrypt_2024h2_parsing() {
parse_entry_extra_data(parsed).expect("extra_data should parse properly");
// extra_data assertions
assert_eq!(input.len(), 0, "All input should be parsed at entry {i}");
assert_eq!(input.len(), 0, "All input should be parsed");
match parsed {
ct::merkle::types::EntryExtraData::X509Certificate(chain) =>
assert_ne!(chain.len(), 0, "x509 chain should not be 0 length"),