File: test_init.lua

package info (click to toggle)
tarantool 1.5.2.20.g5f5d924-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,568 kB
  • ctags: 18,697
  • sloc: ansic: 109,092; sh: 21,312; cpp: 20,633; xml: 9,666; asm: 2,488; python: 2,195; java: 1,759; perl: 1,002; makefile: 679
file content (48 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (2)
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
-- testing start-up script
floor = require("math").floor

--
-- Access to box.cfg from start-up script
--

box_cfg = {}
function copy_box_cfg()
    for i, v in pairs(box.cfg) do
        box_cfg[i] = v
    end
end

function print_config()
    for i, v in pairs(box_cfg) do
        print(i, " = ", v)
    end
end

copy_box_cfg()

--
-- Test for bug #977898
-- Insert from detached fiber
--

local function do_insert()
    box.fiber.detach()
    box.insert(0, 1, 2, 4, 8)
end

fiber = box.fiber.create(do_insert)
box.fiber.resume(fiber)

--
-- Test insert from start-up script
--

box.insert(0, 2, 4, 8, 16)

--
-- A test case for https://github.com/tarantool/tarantool/issues/53
--

assert (require ~= nil)
box.fiber.sleep(0.0)
assert (require ~= nil)