diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-16 10:41:30 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-16 10:41:30 +0100 |
| commit | 0e0f340502beada1cd9ee23857f48b91a0d11a90 (patch) | |
| tree | e4e4087260720adf4bab57edeac6a3d3cb5f14cf /tests | |
| parent | bc118634aca5de415d211cab38c4eaa3d3cca25f (diff) | |
Revert page and inline levels
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/layout/pad.png | bin | 52232 -> 52010 bytes | |||
| -rw-r--r-- | tests/typ/layout/pad.typ | 14 | ||||
| -rw-r--r-- | tests/typ/layout/stack-2.typ | 2 | ||||
| -rw-r--r-- | tests/typeset.rs | 12 |
4 files changed, 10 insertions, 18 deletions
diff --git a/tests/ref/layout/pad.png b/tests/ref/layout/pad.png Binary files differindex 4d381ce2..6ce4016a 100644 --- a/tests/ref/layout/pad.png +++ b/tests/ref/layout/pad.png 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() |
