summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorMalo <57839069+MDLC01@users.noreply.github.com>2024-04-18 14:20:05 +0200
committerGitHub <noreply@github.com>2024-04-18 12:20:05 +0000
commitc5c73ec9315b8148e851693ffa279c75a97982d3 (patch)
tree3f57543bc2dd02e9129c4932ab3b836cf79bb83c /tests/suite
parent02285e8b1fbdf284f2a1115c97f84fc7acb2122e (diff)
Fix compiler panic on stack with infinite spacing (#3918)
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/layout/grid/grid.typ9
-rw-r--r--tests/suite/layout/stack.typ9
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/suite/layout/grid/grid.typ b/tests/suite/layout/grid/grid.typ
index f4f0b90a..2d45095d 100644
--- a/tests/suite/layout/grid/grid.typ
+++ b/tests/suite/layout/grid/grid.typ
@@ -274,3 +274,12 @@ The following:
[],
[a]
)
+
+--- issue-3917-grid-with-infinite-width ---
+// https://github.com/typst/typst/issues/1918
+#set page(width: auto)
+#context layout(available => {
+ let infinite-length = available.width
+ // Error: 3-50 cannot create grid with infinite width
+ grid(gutter: infinite-length, columns: 2)[A][B]
+})
diff --git a/tests/suite/layout/stack.typ b/tests/suite/layout/stack.typ
index 1eca52c9..aad273a5 100644
--- a/tests/suite/layout/stack.typ
+++ b/tests/suite/layout/stack.typ
@@ -80,3 +80,12 @@ World! 🌍
stack([a], 1fr, [b]),
stack([a], v(1fr), [b]),
)
+
+--- issue-1918-stack-with-infinite-spacing ---
+// https://github.com/typst/typst/issues/1918
+#set page(width: auto)
+#context layout(available => {
+ let infinite-length = available.width
+ // Error: 3-40 stack spacing is infinite
+ stack(spacing: infinite-length)[A][B]
+})