update existing calls to expect.error* to new API

develop
myk002 2021-04-03 13:30:52 -07:00
parent a6561911c1
commit 757dbeb238
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 16 additions and 16 deletions

@ -5,9 +5,9 @@ function test.index_name()
end
function test.index_name_bad()
expect.error_match(function()
expect.error_match('not found.$', function()
expect.eq(df.global.world.units.other.SOME_FAKE_NAME, 'container')
end, 'not found.$')
end)
end
function test.index_id()
@ -17,11 +17,11 @@ function test.index_id()
end
function test.index_id_bad()
expect.error_match(function()
expect.error_match('Cannot read field', function()
expect.eq(df.global.world.units.other[df.units_other_id._first_item - 1], 'container')
end, 'Cannot read field')
expect.error_match(function()
end)
expect.error_match('Cannot read field', function()
expect.eq(df.global.world.units.other[df.units_other_id._last_item + 1], 'container')
end, 'Cannot read field')
end)
end

@ -77,16 +77,16 @@ end
function test.index_read_negative()
with_temp_ref(function(x)
expect.error_match(function()
expect.error_match('negative index', function()
expect.true_(x:_displace(1)[-1])
end, 'negative index')
end)
end)
end
function test.index_write_negative()
with_temp_ref(function(x)
expect.error_match(function()
expect.error_match('negative index', function()
x:_displace(1)[-1] = 7
end, 'negative index')
end)
end)
end

@ -12,24 +12,24 @@ end
function test.get_non_primitive()
dfhack.with_temp_object(df.unit:new(), function(unit)
expect.error_match(function()
expect.error_match('not found', function()
return unit:_field('status').ref_target
end, 'not found')
end)
end)
end
function test.set()
dfhack.with_temp_object(df.unit:new(), function(unit)
expect.error_match(function()
expect.error_match('builtin property or method', function()
unit:_field('hist_figure_id').ref_target = df.coord
end, 'builtin property or method')
end)
end)
end
function test.set_non_primitive()
dfhack.with_temp_object(df.unit:new(), function(unit)
expect.error_match(function()
expect.error_match('not found', function()
unit:_field('status').ref_target = df.coord
end, 'not found')
end)
end)
end