use super::*;
#[test]
fn a_panicking_conversion_restores_the_options() {
let options = PdfOptions {
revisions: RevisionStyle::Word,
comments: CommentPlacement::End,
changed_only: true,
..PdfOptions::default()
};
let caught = std::panic::catch_unwind(|| {
with_options(options, || panic!("layout failed"));
});
assert!(caught.is_err());
assert!(matches!(
REVISIONS.with(std::cell::Cell::get),
RevisionStyle::Conventional
));
assert_eq!(
PAGE_PLAN.with(std::cell::Cell::get),
(CommentPlacement::Margin, false)
);
}