summaryrefslogtreecommitdiff
path: root/tests/suite/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-18 14:55:20 +0200
committerGitHub <noreply@github.com>2024-04-18 12:55:20 +0000
commita6a331bd2dbcebbf88901e583cc734b5c6437bcb (patch)
tree5e224f501d131ac4b16b55c6ced3dc82fe5af613 /tests/suite/layout
parent1b091d628da58107134a5b4e04ec063e3c0be705 (diff)
Add regression tests for container sizing with layoutable child (#3955)
Diffstat (limited to 'tests/suite/layout')
-rw-r--r--tests/suite/layout/container.typ26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/suite/layout/container.typ b/tests/suite/layout/container.typ
index b38f6b25..2479a44c 100644
--- a/tests/suite/layout/container.typ
+++ b/tests/suite/layout/container.typ
@@ -18,21 +18,6 @@ Apart
#block(width: 50%, height: 60%, fill: blue)
]
---- box-layoutable-child ---
-// Test box sizing with layoutable child.
-#box(
- width: 50pt,
- height: 50pt,
- fill: yellow,
- path(
- fill: purple,
- (0pt, 0pt),
- (30pt, 30pt),
- (0pt, 30pt),
- (30pt, 0pt),
- ),
-)
-
--- box-width-fr ---
// Test fr box.
Hello #box(width: 1fr, rect(height: 0.7em, width: 100%)) World
@@ -176,6 +161,17 @@ First!
image("/assets/images/rhino.png", width: 30pt)
)
+--- container-layoutable-child ---
+// Test box/block sizing with directly layoutable child.
+//
+// Ensure that the output respects the box size.
+#let check(f) = f(
+ width: 40pt, height: 25pt, fill: aqua,
+ grid(rect(width: 5pt, height: 5pt, fill: blue)),
+)
+
+#stack(dir: ltr, spacing: 1fr, check(box), check(block))
+
--- issue-2128-block-width-box ---
// Test box in 100% width block.
#block(width: 100%, fill: red, box("a box"))