summaryrefslogtreecommitdiff
path: root/tests/suite/math/class.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/class.typ
parent72dd79210602ecc799726fc096b078afbb47f299 (diff)
Better test runner (#3922)
Diffstat (limited to 'tests/suite/math/class.typ')
-rw-r--r--tests/suite/math/class.typ47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/suite/math/class.typ b/tests/suite/math/class.typ
new file mode 100644
index 00000000..7aad0446
--- /dev/null
+++ b/tests/suite/math/class.typ
@@ -0,0 +1,47 @@
+// Test math classes.
+
+--- math-class-chars ---
+// Test characters.
+$ a class("normal", +) b \
+ a class("binary", .) b \
+ lr(class("opening", \/) a/b class("closing", \\)) \
+ { x class("fence", \;) x > 0} \
+ a class("large", \/) b \
+ a class("punctuation", :) b \
+ a class("relation", ~) b \
+ a + class("unary", times) b \
+ class("vary", :) a class("vary", :) b $
+
+--- math-class-content ---
+// Test custom content.
+#let dotsq = square(
+ size: 0.7em,
+ stroke: 0.5pt,
+ align(center+horizon, circle(radius: 0.15em, fill: black))
+)
+
+$ a dotsq b \
+ a class("normal", dotsq) b \
+ a class("vary", dotsq) b \
+ a + class("vary", dotsq) b \
+ a class("punctuation", dotsq) b $
+
+--- math-class-nested ---
+// Test nested.
+#let normal = math.class.with("normal")
+#let pluseq = $class("binary", normal(+) normal(=))$
+$ a pluseq 5 $
+
+--- math-class-exceptions ---
+// Test exceptions.
+$ sqrt(3)\/2 quad d_0.d_1d_2 dots $
+
+--- math-class-limits ---
+// Test if the math class changes the limit configuration.
+$ class("normal", ->)_a $
+$class("relation", x)_a$
+$ class("large", x)_a $
+$class("large", ->)_a$
+
+$limits(class("normal", ->))_a$
+$ scripts(class("relation", x))_a $