summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-16 10:41:30 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-16 10:41:30 +0100
commit0e0f340502beada1cd9ee23857f48b91a0d11a90 (patch)
treee4e4087260720adf4bab57edeac6a3d3cb5f14cf /tests
parentbc118634aca5de415d211cab38c4eaa3d3cca25f (diff)
Revert page and inline levels
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/layout/pad.pngbin52232 -> 52010 bytes
-rw-r--r--tests/typ/layout/pad.typ14
-rw-r--r--tests/typ/layout/stack-2.typ2
-rw-r--r--tests/typeset.rs12
4 files changed, 10 insertions, 18 deletions
diff --git a/tests/ref/layout/pad.png b/tests/ref/layout/pad.png
index 4d381ce2..6ce4016a 100644
--- a/tests/ref/layout/pad.png
+++ b/tests/ref/layout/pad.png
Binary files differ
diff --git a/tests/typ/layout/pad.typ b/tests/typ/layout/pad.typ
index 3729761a..2a91d1ca 100644
--- a/tests/typ/layout/pad.typ
+++ b/tests/typ/layout/pad.typ
@@ -11,19 +11,11 @@
)
)
-Hi #box(pad(left: 10pt)[]) there
+Hi #pad(left: 10pt)[A] there
---
-#let pad(body) = pad(left: 10pt, right: 10pt, body)
-
-// Pad inherits expansion behaviour from stack ....
-#pad[PL #align(right)[PR]]
-
-// ... block ...
-#block(pad[PL #align(right)[PR]])
-
-// ... and box.
-#box(pad[PL #align(right)[PR]])
+// Pad can grow.
+#pad(left: 10pt, right: 10pt)[PL #h(1fr) PR]
---
// Test that the pad node doesn't consume the whole region.
diff --git a/tests/typ/layout/stack-2.typ b/tests/typ/layout/stack-2.typ
index afc9de39..2167f48f 100644
--- a/tests/typ/layout/stack-2.typ
+++ b/tests/typ/layout/stack-2.typ
@@ -17,7 +17,7 @@ World! 🌍
---
#page(height: 2cm)
#font(white)
-#box(fill: forest)[
+#rect(fill: forest)[
#v(1fr)
#h(1fr) Hi you! #h(5pt)
#v(5pt)
diff --git a/tests/typeset.rs b/tests/typeset.rs
index 68e56343..aa4d250b 100644
--- a/tests/typeset.rs
+++ b/tests/typeset.rs
@@ -19,7 +19,7 @@ use typst::geom::{
use typst::image::Image;
use typst::layout::layout;
#[cfg(feature = "layout-cache")]
-use typst::layout::PageNode;
+use typst::library::DocumentNode;
use typst::loading::FsLoader;
use typst::parse::Scanner;
use typst::source::SourceFile;
@@ -231,11 +231,11 @@ fn test_part(
let mut ok = true;
let (frames, mut errors) = match ctx.execute(id) {
- Ok(tree) => {
- let mut frames = layout(ctx, &tree);
+ Ok(document) => {
+ let mut frames = layout(ctx, &document);
#[cfg(feature = "layout-cache")]
- (ok &= test_incremental(ctx, i, &tree, &frames));
+ (ok &= test_incremental(ctx, i, &document, &frames));
if !compare_ref {
frames.clear();
@@ -283,7 +283,7 @@ fn test_part(
fn test_incremental(
ctx: &mut Context,
i: usize,
- tree: &[PageNode],
+ document: &DocumentNode,
frames: &[Rc<Frame>],
) -> bool {
let mut ok = true;
@@ -298,7 +298,7 @@ fn test_incremental(
ctx.layouts.turnaround();
- let cached = layout(ctx, tree);
+ let cached = layout(ctx, document);
let misses = ctx
.layouts
.entries()