diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-12-02 13:37:33 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-12-04 10:12:07 +0100 |
| commit | f8f2ba6a5f8c8ca7dbb85cf17b73332a0c301c60 (patch) | |
| tree | b3bc754509fb3ab4c74493848fe96f116b7907ed /tests/src/run.rs | |
| parent | 76c24ee6e35715cd14bb892d7b6b8d775c680bf7 (diff) | |
Rename `Document` to `PagedDocument`
Diffstat (limited to 'tests/src/run.rs')
| -rw-r--r-- | tests/src/run.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/src/run.rs b/tests/src/run.rs index 1ea19a16..1aa70204 100644 --- a/tests/src/run.rs +++ b/tests/src/run.rs @@ -5,8 +5,7 @@ use std::path::Path; use ecow::eco_vec; use tiny_skia as sk; use typst::diag::{SourceDiagnostic, Warned}; -use typst::layout::{Abs, Frame, FrameItem, Page, Transform}; -use typst::model::Document; +use typst::layout::{Abs, Frame, FrameItem, Page, PagedDocument, Transform}; use typst::visualize::Color; use typst::WorldExt; use typst_pdf::PdfOptions; @@ -116,7 +115,7 @@ impl<'a> Runner<'a> { /// Run custom checks for which it is not worth to create special /// annotations. - fn check_custom(&mut self, doc: Option<&Document>) { + fn check_custom(&mut self, doc: Option<&PagedDocument>) { let errors = crate::custom::check(self.test, &self.world, doc); if !errors.is_empty() { log!(self, "custom check failed"); @@ -127,7 +126,7 @@ impl<'a> Runner<'a> { } /// Check that the document output is correct. - fn check_document(&mut self, document: Option<&Document>) { + fn check_document(&mut self, document: Option<&PagedDocument>) { let live_path = format!("{}/render/{}.png", crate::STORE_PATH, self.test.name); let ref_path = format!("{}/{}.png", crate::REF_PATH, self.test.name); let has_ref = Path::new(&ref_path).exists(); @@ -351,7 +350,7 @@ impl<'a> Runner<'a> { } /// Draw all frames into one image with padding in between. -fn render(document: &Document, pixel_per_pt: f32) -> sk::Pixmap { +fn render(document: &PagedDocument, pixel_per_pt: f32) -> sk::Pixmap { for page in &document.pages { let limit = Abs::cm(100.0); if page.frame.width() > limit || page.frame.height() > limit { |
