Skip to content

Commit

Permalink
Test reparsing generated GeneralizedTimes, to expose a bug that's abo…
Browse files Browse the repository at this point in the history
…ut to get fixed.
  • Loading branch information
acw committed Mar 29, 2019
1 parent c6b8e90 commit b72f384
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,21 @@ mod tests {
resvec.remove(0);
resvec.remove(0);
assert_eq!(String::from_utf8(resvec).unwrap(), s);
match from_der_(vec, 0) {
Err(_) =>
assert_eq!(format!("Broken [reparse]: {}", d), s),
Ok(mut vec) => {
assert_eq!(vec.len(), 1);
match vec.pop() {
None =>
assert!(false, "The world's gone mad again."),
Some(ASN1Block::GeneralizedTime(_, d2)) =>
assert_eq!(&d2, d),
Some(_) =>
assert!(false, "Bad reparse of GeneralizedTime.")
}
}
}
}
}
}
Expand Down

0 comments on commit b72f384

Please sign in to comment.