Lua: fix placement of tests for Block elements in pandoc module tests
This commit is contained in:
parent
af97598954
commit
e1cf0ad1be
1 changed files with 120 additions and 120 deletions
|
@ -105,6 +105,49 @@ return {
|
|||
assert.are_equal(count, 3)
|
||||
end)
|
||||
},
|
||||
group 'HTML-like attribute tables' {
|
||||
test('in element constructor', function ()
|
||||
local html_attributes = {
|
||||
id = 'the-id',
|
||||
class = 'class1 class2',
|
||||
width = '11',
|
||||
height = '12'
|
||||
}
|
||||
local attr = pandoc.Span('test', html_attributes).attr
|
||||
assert.are_equal(attr.identifier, 'the-id')
|
||||
assert.are_equal(attr.classes[1], 'class1')
|
||||
assert.are_equal(attr.classes[2], 'class2')
|
||||
assert.are_equal(attr.attributes.width, '11')
|
||||
assert.are_equal(attr.attributes.height, '12')
|
||||
end),
|
||||
test('element attr setter', function ()
|
||||
local html_attributes = {
|
||||
id = 'the-id',
|
||||
class = 'class1 class2',
|
||||
width = "11",
|
||||
height = "12"
|
||||
}
|
||||
local span = pandoc.Span 'test'
|
||||
span.attr = html_attributes
|
||||
span = span:clone() -- normalize
|
||||
assert.are_equal(span.attr.identifier, 'the-id')
|
||||
assert.are_equal(span.attr.classes[1], 'class1')
|
||||
assert.are_equal(span.attr.classes[2], 'class2')
|
||||
assert.are_equal(span.attr.attributes.width, '11')
|
||||
assert.are_equal(span.attr.attributes.height, '12')
|
||||
end),
|
||||
test('element attrbutes setter', function ()
|
||||
local attributes = {
|
||||
width = "11",
|
||||
height = "12"
|
||||
}
|
||||
local span = pandoc.Span 'test'
|
||||
span.attributes = attributes
|
||||
assert.are_equal(span.attr.attributes.width, '11')
|
||||
assert.are_equal(span.attr.attributes.height, '12')
|
||||
end)
|
||||
}
|
||||
},
|
||||
group "Block elements" {
|
||||
group "BulletList" {
|
||||
test('access items via property `content`', function ()
|
||||
|
@ -223,50 +266,7 @@ return {
|
|||
}
|
||||
)
|
||||
end)
|
||||
}
|
||||
},
|
||||
group 'HTML-like attribute tables' {
|
||||
test('in element constructor', function ()
|
||||
local html_attributes = {
|
||||
id = 'the-id',
|
||||
class = 'class1 class2',
|
||||
width = '11',
|
||||
height = '12'
|
||||
}
|
||||
local attr = pandoc.Span('test', html_attributes).attr
|
||||
assert.are_equal(attr.identifier, 'the-id')
|
||||
assert.are_equal(attr.classes[1], 'class1')
|
||||
assert.are_equal(attr.classes[2], 'class2')
|
||||
assert.are_equal(attr.attributes.width, '11')
|
||||
assert.are_equal(attr.attributes.height, '12')
|
||||
end),
|
||||
test('element attr setter', function ()
|
||||
local html_attributes = {
|
||||
id = 'the-id',
|
||||
class = 'class1 class2',
|
||||
width = "11",
|
||||
height = "12"
|
||||
}
|
||||
local span = pandoc.Span 'test'
|
||||
span.attr = html_attributes
|
||||
span = span:clone() -- normalize
|
||||
assert.are_equal(span.attr.identifier, 'the-id')
|
||||
assert.are_equal(span.attr.classes[1], 'class1')
|
||||
assert.are_equal(span.attr.classes[2], 'class2')
|
||||
assert.are_equal(span.attr.attributes.width, '11')
|
||||
assert.are_equal(span.attr.attributes.height, '12')
|
||||
end),
|
||||
test('element attrbutes setter', function ()
|
||||
local attributes = {
|
||||
width = "11",
|
||||
height = "12"
|
||||
}
|
||||
local span = pandoc.Span 'test'
|
||||
span.attributes = attributes
|
||||
assert.are_equal(span.attr.attributes.width, '11')
|
||||
assert.are_equal(span.attr.attributes.height, '12')
|
||||
end)
|
||||
}
|
||||
},
|
||||
group 'Other types' {
|
||||
group 'SimpleTable' {
|
||||
|
|
Loading…
Add table
Reference in a new issue