blob: 48a6950220a1dccf7d5d2b206d1f49fcb008282f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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) $
|