summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-12-18 13:54:14 -0300
committerGitHub <noreply@github.com>2024-12-18 16:54:14 +0000
commit9b697d59ae4d06a0ee0b1bc6b3879d3b9c67a8d4 (patch)
tree5f891cf62db08983d07ca7845aafe548574eebe5 /tests
parent21e608e6e9bfe7c7b1111152c0f5647cfe1e9e4e (diff)
Fix infinite loop with footnote which never fits (#5498)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/issue-5496-footnote-in-float-never-fits.pngbin0 -> 399 bytes
-rw-r--r--tests/ref/issue-5496-footnote-never-fits-multiple.pngbin0 -> 1211 bytes
-rw-r--r--tests/ref/issue-5496-footnote-never-fits.pngbin0 -> 399 bytes
-rw-r--r--tests/ref/issue-5496-footnote-separator-never-fits.pngbin0 -> 226 bytes
-rw-r--r--tests/suite/layout/flow/footnote.typ43
5 files changed, 43 insertions, 0 deletions
diff --git a/tests/ref/issue-5496-footnote-in-float-never-fits.png b/tests/ref/issue-5496-footnote-in-float-never-fits.png
new file mode 100644
index 00000000..4ae5903d
--- /dev/null
+++ b/tests/ref/issue-5496-footnote-in-float-never-fits.png
Binary files differ
diff --git a/tests/ref/issue-5496-footnote-never-fits-multiple.png b/tests/ref/issue-5496-footnote-never-fits-multiple.png
new file mode 100644
index 00000000..24fcf709
--- /dev/null
+++ b/tests/ref/issue-5496-footnote-never-fits-multiple.png
Binary files differ
diff --git a/tests/ref/issue-5496-footnote-never-fits.png b/tests/ref/issue-5496-footnote-never-fits.png
new file mode 100644
index 00000000..4ae5903d
--- /dev/null
+++ b/tests/ref/issue-5496-footnote-never-fits.png
Binary files differ
diff --git a/tests/ref/issue-5496-footnote-separator-never-fits.png b/tests/ref/issue-5496-footnote-separator-never-fits.png
new file mode 100644
index 00000000..4fe4fdee
--- /dev/null
+++ b/tests/ref/issue-5496-footnote-separator-never-fits.png
Binary files differ
diff --git a/tests/suite/layout/flow/footnote.typ b/tests/suite/layout/flow/footnote.typ
index 885ef627..d7b31b99 100644
--- a/tests/suite/layout/flow/footnote.typ
+++ b/tests/suite/layout/flow/footnote.typ
@@ -315,3 +315,46 @@ A #footnote(numbering: "*")[B]<fn>, C @fn, D @fn, E @fn.
float: true,
footnote[b]
)
+
+--- issue-5496-footnote-never-fits ---
+// Test whether a footnote which is always too large would cause an infinite
+// loop.
+#set page(width: 20pt, height: 20pt)
+#set footnote.entry(indent: 0pt)
+
+#footnote(text(size: 15pt)[a] * 100)
+
+--- issue-5496-footnote-in-float-never-fits ---
+// Test whether an overlarge footnote in a float also does not cause an
+// infinite loop.
+#set page(width: 20pt, height: 20pt)
+
+#place(
+ top,
+ float: true,
+ footnote(text(size: 15pt)[a] * 100)
+)
+
+--- issue-5496-footnote-never-fits-multiple ---
+// Test whether multiple overlarge footnotes are properly split up across
+// pages.
+#set page(width: 20pt, height: 20pt)
+#set footnote.entry(indent: 0pt)
+
+A
+
+#footnote(text(size: 15pt)[a] * 100)
+#footnote(text(size: 15pt)[b] * 100)
+#footnote[Fit]
+
+B
+
+C
+
+--- issue-5496-footnote-separator-never-fits ---
+// Test whether an overlarge footnote separator does not cause an infinite
+// loop and compiles.
+#set page(height: 2em)
+#set footnote.entry(separator: v(5em))
+
+#footnote[]