Remove some unused functions from checker_spec
@@ -9,23 +9,6 @@ local function run_checker(code)
return prog, table.concat(errs, "\n")
end
--- Return a version of t2 that only contains fields present in t1 (recursively)
--- Example:
--- t1 = { b = { c = 10 } e = 40 }
--- t2 = { a = 1, b = { c = 20, d = 30} }
--- out = { b = { c = 20 } }
-local function restrict(t1, t2)
- if type(t1) == 'table' and type(t2) == 'table' then
- local out = {}
- for k,_ in pairs(t1) do
- out[k] = restrict(t1[k], t2[k])
- end
- return out
- else
- return t2
- end
-end
-
local function assert_type_check(code)
local prog, errs = run_checker(code)
assert.truthy(prog, errs)
@@ -37,13 +20,6 @@ local function assert_type_error(expected, code)
assert.match(expected, errs)
end
--- To avoid having these tests break all the time when we make insignificant
--- changes to the AST, we only verify a subset of the AST.
-local function assert_prog(program, expected)
- local received = restrict(expected, program)
- assert.are.same(expected, received)
-end
-
describe("Titan type checker", function()
teardown(function()
