summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/foundations/std.typ31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/suite/foundations/std.typ b/tests/suite/foundations/std.typ
new file mode 100644
index 00000000..48a69502
--- /dev/null
+++ b/tests/suite/foundations/std.typ
@@ -0,0 +1,31 @@
+// Test 'std', a module with the standard library
+
+--- std-basic-access ---
+#test(std.grid, grid)
+#test(std.calc, calc)
+
+--- std-import ---
+#import std: grid as banana
+#test(grid, banana)
+
+--- std-of-shadowed ---
+#let my-grid = grid[a][b]
+#let grid = "oh no!"
+#test(my-grid.func(), std.grid)
+
+--- std-shadowing ---
+#let std = 5
+// Error: 6-10 cannot access fields on type integer
+#std.grid
+
+--- std-mutation ---
+// Error: 3-6 cannot mutate a constant: std
+#(std = 10)
+
+--- std-shadowed-mutation ---
+#let std = 10
+#(std = 7)
+#test(std, 7)
+
+--- std-math ---
+$ std.rect(x + y = 5) $