1plugin =
2{
3    type = "piglet",
4    name = "piglet::cursor",
5    test = function()
6        dofile(SCRIPT_DIR .. "/../common.lua")
7        return run_tests(tests)
8    end
9}
10
11tests =
12{
13    init_default = function()
14        local cur = Cursor.new()
15        assert(cur)
16    end,
17
18    init_from_string = function()
19        local cur = Cursor.new("abcdefgh")
20        assert(cur)
21    end,
22
23    init_from_raw_buffer = function()
24        local cur = Cursor.new(RawBuffer.new("abcdefgh"))
25        assert(cur)
26    end,
27
28    reset_default = function()
29        local cur = Cursor.new()
30        cur:reset()
31    end,
32
33    reset_from_string = function()
34        local cur = Cursor.new()
35        cur:reset("abcdefgh")
36    end,
37
38    reset_from_raw_buffer = function()
39        local cur = Cursor.new()
40        cur:reset(RawBuffer.new("abcdefgh"))
41    end
42}
43