summaryrefslogtreecommitdiff
path: root/tests/typ/code
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-12-15 11:12:38 +0100
committerLaurenz <laurmaedje@gmail.com>2021-12-15 11:12:38 +0100
commit57f5c0a1b15775f9500335f455c7dc7d70cea9f5 (patch)
tree1448c12ba70acd3bcd96aea973a511641497f3de /tests/typ/code
parentae38be9097bbb32142ef776e77e627ac12379000 (diff)
Set Rules Episode V: The Tests Strike Back
Diffstat (limited to 'tests/typ/code')
-rw-r--r--tests/typ/code/ops-invalid.typ2
-rw-r--r--tests/typ/code/ops.typ10
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ
index 91dd576f..340e4c9f 100644
--- a/tests/typ/code/ops-invalid.typ
+++ b/tests/typ/code/ops-invalid.typ
@@ -26,7 +26,7 @@
{not ()}
---
-// Error: 2-18 cannot apply '<=' to linear and relative
+// Error: 2-18 cannot apply '<=' to relative length and relative
{30% + 1pt <= 40%}
---
diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ
index 04a72e72..be2cdb48 100644
--- a/tests/typ/code/ops.typ
+++ b/tests/typ/code/ops.typ
@@ -64,7 +64,7 @@
}
// Linears cannot be divided by themselves.
- if type(v) != "linear" {
+ if type(v) != "relative length" {
test(v / v, 1.0)
test(v / v == 1, true)
}
@@ -130,12 +130,14 @@
#test(test == test, true)
#test((() => {}) == (() => {}), false)
-// Templates also compare by identity.
+// Templates compare by shallow equality.
#let t = [a]
#test(t == t, true)
-#test([] == [], false)
+#test([] == [], true)
+#test([a] == [a], true)
#test([] == [a], false)
-#test([a] == [a], false)
+#test([[a]] == [a], false)
+#test(box[] == box[], false)
---
// Test comparison operators.