From 759aa5095101351bc2e4d2c4629df945b743e7db Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 1 Nov 2021 15:43:51 +0100 Subject: Lua: restore `content` property on Header elements --- test/lua/module/pandoc.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4e0b5188e..21a6de2de 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -245,6 +245,29 @@ return { ) end), }, + group 'Header' { + test('access inlines via property `content`', function () + local header = pandoc.Header(1, 'test') + assert.are_same(header.content, {pandoc.Str 'test'}) + + header.content = {'new text'} + assert.are_equal(header, pandoc.Header(1, 'new text')) + end), + test('access Attr via property `attr`', function () + local header = pandoc.Header(1, 'test', {'my-test'}) + assert.are_same(header.attr, pandoc.Attr{'my-test'}) + + header.attr = 'second-test' + assert.are_equal(header, pandoc.Header(1, 'test', 'second-test')) + end), + test('access level via property `level`', function () + local header = pandoc.Header(3, 'test') + assert.are_same(header.level, 3) + + header.level = 2 + assert.are_equal(header, pandoc.Header(2, 'test')) + end), + }, group 'LineBlock' { test('access lines via property `content`', function () local spc = pandoc.Space() -- cgit v1.2.3