summaryrefslogtreecommitdiff
path: root/tests/suite/math/root.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-13 10:39:45 +0200
committerGitHub <noreply@github.com>2024-04-13 08:39:45 +0000
commit020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch)
treec0027ad22046e2726c22298461327823d6b88d53 /tests/suite/math/root.typ
parent72dd79210602ecc799726fc096b078afbb47f299 (diff)
Better test runner (#3922)
Diffstat (limited to 'tests/suite/math/root.typ')
-rw-r--r--tests/suite/math/root.typ45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/suite/math/root.typ b/tests/suite/math/root.typ
new file mode 100644
index 00000000..a690802e
--- /dev/null
+++ b/tests/suite/math/root.typ
@@ -0,0 +1,45 @@
+// Test roots.
+
+--- math-root-basic ---
+// Test root with more than one character.
+$A = sqrt(x + y) = c$
+
+--- math-root-radical-attachment ---
+// Test root size with radicals containing attachments.
+$ sqrt(a) quad
+ sqrt(f) quad
+ sqrt(q) quad
+ sqrt(a^2) \
+ sqrt(n_0) quad
+ sqrt(b^()) quad
+ sqrt(b^2) quad
+ sqrt(q_1^2) $
+
+--- math-root-precomposed ---
+// Test precomposed vs constructed roots.
+// 3 and 4 are precomposed.
+$sqrt(x)$
+$root(2, x)$
+$root(3, x)$
+$root(4, x)$
+$root(5, x)$
+
+--- math-root-large-body ---
+// Test large bodies
+$ sqrt([|x|]^2 + [|y|]^2) < [|z|] $
+$ v = sqrt((1/2) / (4/5))
+ = root(3, (1/2/3) / (4/5/6))
+ = root(4, ((1/2) / (3/4)) / ((1/2) / (3/4))) $
+
+--- math-root-large-index ---
+// Test large index.
+$ root(2, x) quad
+ root(3/(2/1), x) quad
+ root(1/11, x) quad
+ root(1/2/3, 1) $
+
+--- math-root-syntax ---
+// Test shorthand.
+$ √2^3 = sqrt(2^3) $
+$ √(x+y) quad ∛x quad ∜x $
+$ (√2+3) = (sqrt(2)+3) $