summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-18 14:55:20 +0200
committerLaurenz <laurmaedje@gmail.com>2024-05-17 14:27:59 +0200
commit2f8b97f9c29eff0cb9f003749a0f4f5c64e7c54e (patch)
tree78c6184ac8495f51fa66a4b95900228e26acd883
parentac7dff10b27ed387bd936c5df8a9e7937b75c86d (diff)
Add regression tests for container sizing with layoutable child (#3955)
-rw-r--r--tests/ref/box-layoutable-child.pngbin257 -> 0 bytes
-rw-r--r--tests/ref/container-layoutable-child.pngbin0 -> 117 bytes
-rw-r--r--tests/suite/layout/container.typ26
3 files changed, 11 insertions, 15 deletions
diff --git a/tests/ref/box-layoutable-child.png b/tests/ref/box-layoutable-child.png
deleted file mode 100644
index a1960a24..00000000
--- a/tests/ref/box-layoutable-child.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/container-layoutable-child.png b/tests/ref/container-layoutable-child.png
new file mode 100644
index 00000000..972ccb61
--- /dev/null
+++ b/tests/ref/container-layoutable-child.png
Binary files differ
diff --git a/tests/suite/layout/container.typ b/tests/suite/layout/container.typ
index ede051db..aff26bac 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
@@ -177,6 +162,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"))