summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMax <me@mkor.je>2024-12-20 10:15:18 +0000
committerGitHub <noreply@github.com>2024-12-20 10:15:18 +0000
commitc3334a55fe53253b55943a4b713bff532e876d95 (patch)
tree3d58c97eefb14d3705ea527cb4dc967bf22268fe /tests
parent6c2d54bbe3df70670afef6d3f61750daeb2adf34 (diff)
Fix arbitrarily nested equations in the base of `math.attach` (#5613)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/math-attach-nested-base.pngbin1047 -> 1377 bytes
-rw-r--r--tests/ref/math-attach-nested-deep-base.pngbin0 -> 185 bytes
-rw-r--r--tests/ref/math-stretch-attach-nested-equation.pngbin180 -> 415 bytes
-rw-r--r--tests/suite/math/attach.typ15
-rw-r--r--tests/suite/math/stretch.typ8
5 files changed, 22 insertions, 1 deletions
diff --git a/tests/ref/math-attach-nested-base.png b/tests/ref/math-attach-nested-base.png
index 54c62387..4b8126e7 100644
--- a/tests/ref/math-attach-nested-base.png
+++ b/tests/ref/math-attach-nested-base.png
Binary files differ
diff --git a/tests/ref/math-attach-nested-deep-base.png b/tests/ref/math-attach-nested-deep-base.png
new file mode 100644
index 00000000..e745e6b6
--- /dev/null
+++ b/tests/ref/math-attach-nested-deep-base.png
Binary files differ
diff --git a/tests/ref/math-stretch-attach-nested-equation.png b/tests/ref/math-stretch-attach-nested-equation.png
index 5ab4fbb5..3ddb0d00 100644
--- a/tests/ref/math-stretch-attach-nested-equation.png
+++ b/tests/ref/math-stretch-attach-nested-equation.png
Binary files differ
diff --git a/tests/suite/math/attach.typ b/tests/suite/math/attach.typ
index 56fa47c5..cedc3a4a 100644
--- a/tests/suite/math/attach.typ
+++ b/tests/suite/math/attach.typ
@@ -167,9 +167,22 @@ $ attach(a^b, b: c) quad
#let a0 = math.attach(math.alpha, b: [0])
#let a1 = $alpha^1$
+#let a2 = $attach(a1, bl: 3)$
$ a0 + a1 + a0_2 \
- a1_2 + a0^2 + a1^2 $
+ a1_2 + a0^2 + a1^2 \
+ a2 + a2_2 + a2^2 $
+
+--- math-attach-nested-deep-base ---
+// Test attachments when the base has attachments and is nested arbitrarily
+// deep.
+#{
+ let var = $x^1$
+ for i in range(24) {
+ var = $var$
+ }
+ $var_2$
+}
--- math-attach-scripts-extended-shapes ---
// Test script attachments positioning if the base is an extended shape (or a
diff --git a/tests/suite/math/stretch.typ b/tests/suite/math/stretch.typ
index 6bf13e25..1377f4d2 100644
--- a/tests/suite/math/stretch.typ
+++ b/tests/suite/math/stretch.typ
@@ -83,3 +83,11 @@ $ stretch(base, size: #50%) $
// Test stretching with attachments when nested in an equation.
#let body = $stretch(=)$
$ body^"text" $
+
+#{
+ let body = $stretch(=)$
+ for i in range(24) {
+ body = $body$
+ }
+ $body^"long text"$
+}