summaryrefslogtreecommitdiff
path: root/test/definition/init.lua
blob: 9bd7a1d885dd25cff1669f251a83296bb3e3d630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local matcher = require 'matcher'

rawset(_G, 'TEST', true)

function TEST(script)
    local start  = script:find('<!', 1, true) + 2
    local finish = script:find('!>', 1, true) - 1
    local pos    = script:find('<?', 1, true) + 2
    local new_script = script:gsub('<[!?]', '  '):gsub('[!?]>', '  ')

    local suc, a, b = matcher.definition(new_script, pos)
    assert(suc)
    assert(a == start)
    assert(b == finish)
end

require 'definition.set'
require 'definition.local'
require 'definition.arg'
require 'definition.function'
--require 'definition.table'
require 'definition.bug'