|
|
@ -12,24 +12,24 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function test.get_non_primitive()
|
|
|
|
function test.get_non_primitive()
|
|
|
|
dfhack.with_temp_object(df.unit:new(), function(unit)
|
|
|
|
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
|
|
|
|
return unit:_field('status').ref_target
|
|
|
|
end, 'not found')
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function test.set()
|
|
|
|
function test.set()
|
|
|
|
dfhack.with_temp_object(df.unit:new(), function(unit)
|
|
|
|
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
|
|
|
|
unit:_field('hist_figure_id').ref_target = df.coord
|
|
|
|
end, 'builtin property or method')
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function test.set_non_primitive()
|
|
|
|
function test.set_non_primitive()
|
|
|
|
dfhack.with_temp_object(df.unit:new(), function(unit)
|
|
|
|
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
|
|
|
|
unit:_field('status').ref_target = df.coord
|
|
|
|
end, 'not found')
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|