summaryrefslogtreecommitdiff
path: root/tests/typ/compute
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/compute')
-rw-r--r--tests/typ/compute/calc.typ4
-rw-r--r--tests/typ/compute/construct.typ21
-rw-r--r--tests/typ/compute/foundations.typ12
3 files changed, 19 insertions, 18 deletions
diff --git a/tests/typ/compute/calc.typ b/tests/typ/compute/calc.typ
index bdaf28a7..536c637a 100644
--- a/tests/typ/compute/calc.typ
+++ b/tests/typ/compute/calc.typ
@@ -11,7 +11,7 @@
#test(float(10), 10.0)
#test(float(50% * 30%), 0.15)
#test(float("31.4e-1"), 3.14)
-#test(type(float(10)), "float")
+#test(type(float(10)), float)
---
#test(calc.round(calc.e, digits: 2), 2.72)
@@ -22,7 +22,7 @@
#int(10pt)
---
-// Error: 8-13 expected boolean, integer, ratio, string, or float, found function
+// Error: 8-13 expected boolean, integer, ratio, string, or float, found type
#float(float)
---
diff --git a/tests/typ/compute/construct.typ b/tests/typ/compute/construct.typ
index 80e0876a..bef86fae 100644
--- a/tests/typ/compute/construct.typ
+++ b/tests/typ/compute/construct.typ
@@ -62,7 +62,8 @@
---
// Error: 12-24 expected float or ratio, found string
-#color.mix((red, "yes"), (green, "no"))
+// Error: 26-39 expected float or ratio, found string
+#color.mix((red, "yes"), (green, "no"), (green, 10%))
---
// Error: 12-23 expected a color or color-weight pair
@@ -103,7 +104,7 @@
#test(str(10 / 3).len() > 10, true)
---
-// Error: 6-8 expected integer, float, label, bytes, or string, found content
+// Error: 6-8 expected integer, float, bytes, label, type, or string, found content
#str([])
---
@@ -128,11 +129,11 @@
#str.to-unicode("ab")
---
-// Error: 19-21 0xffffffffffffffff is not a valid codepoint
-#str.from-unicode(-1) // negative values are not valid
+// Error: 19-21 number must be at least zero
+#str.from-unicode(-1)
---
-// Error: 19-27 0x110000 is not a valid codepoint
+// Error: 18-28 0x110000 is not a valid codepoint
#str.from-unicode(0x110000) // 0x10ffff is the highest valid code point
---
@@ -205,21 +206,21 @@
#datetime(year: 2000, month: 2, day: 30)
---
-// Error: 26-35 missing closing bracket for bracket at index 0
+// Error: 27-34 missing closing bracket for bracket at index 0
#datetime.today().display("[year")
---
-// Error: 26-39 invalid component name 'nothing' at index 1
+// Error: 27-38 invalid component name 'nothing' at index 1
#datetime.today().display("[nothing]")
---
-// Error: 26-51 invalid modifier 'wrong' at index 6
+// Error: 27-50 invalid modifier 'wrong' at index 6
#datetime.today().display("[year wrong:last_two]")
---
-// Error: 26-34 expected component name at index 2
+// Error: 27-33 expected component name at index 2
#datetime.today().display(" []")
---
-// Error: 26-36 failed to format datetime (insufficient information)
+// Error: 2-36 failed to format datetime (insufficient information)
#datetime.today().display("[hour]")
diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ
index 3da2e601..4e74966f 100644
--- a/tests/typ/compute/foundations.typ
+++ b/tests/typ/compute/foundations.typ
@@ -2,9 +2,9 @@
// Ref: false
---
-#test(type(1), "integer")
-#test(type(ltr), "direction")
-#test(type(10 / 3), "float")
+#test(type(1), int)
+#test(type(ltr), direction)
+#test(type(10 / 3), float)
---
#test(repr(ltr), "ltr")
@@ -68,9 +68,9 @@
---
// Test the `type` function.
-#test(type(1), "integer")
-#test(type(ltr), "direction")
-#test(type(10 / 3), "float")
+#test(type(1), int)
+#test(type(ltr), direction)
+#test(type(10 / 3), float)
---
// Test the eval function.