spec(teal_type_definition): test Record node
This commit is contained in:
parent
7b08f10150
commit
eee6a47fbe
|
@ -122,4 +122,27 @@ describe("Teal type definition Printer", function()
|
||||||
|
|
||||||
return Function_Module
|
return Function_Module
|
||||||
]]))
|
]]))
|
||||||
|
|
||||||
|
it("should print nested Record exposed by the module", gen(
|
||||||
|
{
|
||||||
|
children = {
|
||||||
|
{
|
||||||
|
children = {},
|
||||||
|
name = "Nested",
|
||||||
|
token = "record",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
name = "Nested_Module",
|
||||||
|
token = "module",
|
||||||
|
},
|
||||||
|
[[
|
||||||
|
-- This file was auto-generated.
|
||||||
|
|
||||||
|
local record Nested_Module
|
||||||
|
record Nested
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return Nested_Module
|
||||||
|
]]))
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -37,7 +37,7 @@ local node_printer <total>: { Node.Token : Node_Printer_Function } = {
|
||||||
},
|
},
|
||||||
["record"] = {
|
["record"] = {
|
||||||
before_node = function(node: Node): string
|
before_node = function(node: Node): string
|
||||||
return "local record " .. node.name
|
return "record " .. node.name .. "\n"
|
||||||
end,
|
end,
|
||||||
on_node = function(node: Node): string
|
on_node = function(node: Node): string
|
||||||
return print_children(node)
|
return print_children(node)
|
||||||
|
|
Loading…
Reference in New Issue