-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest-proxy.lua
112 lines (77 loc) · 1.46 KB
/
test-proxy.lua
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
local proxy = require 'proxy'
p = proxy.new()
p:dostring([[
print('This is the proxy state')
print('n is:')
print(n)
]])
local t2 = {{id = 42, text = ' foo'}, {id = 10, text = 'bar'}}
p.t2 = t2
print(p.t2[2].text)
p.n = 42 -- creates n in the proxy state
p:dostring([[print('n is ' .. n) n = n + 1]])
print(p.n)
p.Query = {
op = 'test',
num = 73
}
print('print in the proxy')
p:dostring([[print(Query.op) print(Query.num)]])
print('print locally')
print(p.Query.op)
print(p.Query.num)
p.Query.num = 15
p:dostring('print(Query.num)')
t = {
a = 1,
b = true,
c = 3
}
p.t = t
p:dostring('print(t.a) print(t.b) print(t.c)')
p:dostring([[print('n is now ' .. n)]])
print("abc " .. p.Query.op)
p:dostring([[function test ()
print('this is the test function in the proxy')
end
print('function test created')]])
p.test()
print('index tests')
p.posgroup = {}
p.posgroup[1] = {
name = 'abc'
}
print('--- create table at index 2')
p.posgroup[2] = {}
print('--- set def ')
p.posgroup[2].name = 'def'
print('--- set sale as table')
p.posgroup[2].sale = {}
print('finally')
p:dostring([[
print(posgroup.name)
for k, item in pairs(posgroup) do
print(item.name)
end
]])
print('---')
images = {}
for n = 1, 110 do
images[n] = {
id = 10,
name = 'test',
descr = 'descr',
threshold = 100
}
end
p.images = {}
for n = 1, 110 do
p.images[n] = {
id = 10,
name = 'test',
descr = 'descr',
threshold = 100
}
end
print('length of p.images', #p.images)
print('end')