Skip to content

Commit

Permalink
Add test for NameIterator behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jan 20, 2025
1 parent fb0f8c7 commit 02c153c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/subject_name/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,4 +445,12 @@ mod tests {
"Unsupported(0x66)"
);
}

#[test]
fn name_iter_end_after_error() {
let input = untrusted::Input::from(&[0x30]);
let mut iter = NameIterator::new(Some(input));
assert_eq!(iter.next().unwrap().unwrap_err(), Error::BadDer);
assert!(iter.next().is_none());
}
}

0 comments on commit 02c153c

Please sign in to comment.