diff --git a/test/structures/other_vectors.lua b/test/structures/other_vectors.lua index 43a50dc2a..0fb1a9630 100644 --- a/test/structures/other_vectors.lua +++ b/test/structures/other_vectors.lua @@ -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 diff --git a/test/structures/primitive_refs.lua b/test/structures/primitive_refs.lua index 9de5bc980..13bd3ed90 100644 --- a/test/structures/primitive_refs.lua +++ b/test/structures/primitive_refs.lua @@ -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 diff --git a/test/structures/ref_target.lua b/test/structures/ref_target.lua index 05818ee06..b9c568805 100644 --- a/test/structures/ref_target.lua +++ b/test/structures/ref_target.lua @@ -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