summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/code/ops.typ12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ
index 6d788df1..58fd957f 100644
--- a/tests/typ/code/ops.typ
+++ b/tests/typ/code/ops.typ
@@ -112,6 +112,7 @@
---
// Test equality operators.
+// Most things compare by value.
#test(1 == "hi", false)
#test(1 == 1.0, true)
#test(30% == 30% + 0cm, true)
@@ -124,6 +125,17 @@
#test((a: 2 - 1.0, b: 2) == (b: 2, a: 1), true)
#test("a" != "a", false)
+// Functions compare by identity.
+#test(test == test, true)
+#test((() => {}) == (() => {}), false)
+
+// Templates also compare by identity.
+#let t = [a]
+#test(t == t, true)
+#test([] == [], false)
+#test([] == [a], false)
+#test([a] == [a], false)
+
---
// Test comparison operators.