summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/custom.rs7
-rw-r--r--tests/src/run.rs9
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/src/custom.rs b/tests/src/custom.rs
index 9a5fef03..965312ab 100644
--- a/tests/src/custom.rs
+++ b/tests/src/custom.rs
@@ -1,7 +1,8 @@
use std::fmt::Write;
use typst::foundations::Smart;
-use typst::model::{Document, DocumentInfo};
+use typst::layout::PagedDocument;
+use typst::model::DocumentInfo;
use typst::World;
use crate::collect::Test;
@@ -18,7 +19,7 @@ macro_rules! test_eq {
/// Run special checks for specific tests for which it is not worth it to create
/// custom annotations.
-pub fn check(test: &Test, world: &TestWorld, doc: Option<&Document>) -> String {
+pub fn check(test: &Test, world: &TestWorld, doc: Option<&PagedDocument>) -> String {
let mut sink = String::new();
match test.name.as_str() {
"document-set-author-date" => {
@@ -41,6 +42,6 @@ pub fn check(test: &Test, world: &TestWorld, doc: Option<&Document>) -> String {
}
/// Extract the document information.
-fn info(doc: Option<&Document>) -> DocumentInfo {
+fn info(doc: Option<&PagedDocument>) -> DocumentInfo {
doc.map(|doc| doc.info.clone()).unwrap_or_default()
}
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 {