summaryrefslogtreecommitdiff
path: root/server-beta/test/definition/set.lua
blob: b7e7e5d40328713cc922b8b45ba353a6f69642a6 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
TEST [[
<!x!> = 1
<?x?>()
]]

TEST [[
do
    <!global!> = 1
end
<?global?>()
]]

TEST [[
<!x!> = 1
do
    local x = 1
end
<?x?>()
]]

TEST [[
x = 1
do
    local <!x!> = 1
    do
        <!x!> = 2
    end
    <?x?>()
end
]]

TEST [[
<!x!> = 1
if y then
    <!x!> = 2
else
    <!x!> = 3
end
print(<?x?>)
]]

TEST [[
<!_G.x!> = 1
print(<?x?>)
]]

TEST [[
<!rawset(_G, 'x', 1)!>
print(<?x?>)
]]