diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/std-math.png | bin | 0 -> 298 bytes | |||
| -rw-r--r-- | tests/suite/foundations/std.typ | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/ref/std-math.png b/tests/ref/std-math.png Binary files differnew file mode 100644 index 00000000..f7cecf47 --- /dev/null +++ b/tests/ref/std-math.png 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) $ |
