From e98921ae571717d3d7c1fbaf7d7d527361b664c9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 10 Jan 2020 20:13:06 +0100 Subject: pandoc.List.lua: make `pandoc.List` a callable constructor It is now possible to construct a new List via `pandoc.List()` instead of `pandoc.List:new()`. --- test/lua/module/pandoc-list.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/lua/module') diff --git a/test/lua/module/pandoc-list.lua b/test/lua/module/pandoc-list.lua index faa5e966e..fb0c1c495 100644 --- a/test/lua/module/pandoc-list.lua +++ b/test/lua/module/pandoc-list.lua @@ -6,6 +6,15 @@ local test = tasty.test_case local group = tasty.test_group return { + group 'List as function' { + test('equivalent to List:new', function (x) + local new = List:new {'ramen'} + local list = List {'ramen'} + assert.are_same(new, list) + assert.are_equal(getmetatable(new), getmetatable(list)) + end) + }, + group 'new' { test('make table usable as list', function () local test = List:new{1, 1, 2, 3, 5} -- cgit v1.2.3