diff --git a/tests/support/assertStringContains.m b/tests/support/assertStringContains.m index 2a4dc21..556c752 100644 --- a/tests/support/assertStringContains.m +++ b/tests/support/assertStringContains.m @@ -1,5 +1,4 @@ - function assertStringContains(text, subtext) assert(~isempty(strfind(text, subtext)), ... - 'String ''%s'' should contain ''%s'', but it doesn''t.'); + 'String ''%s'' should contain ''%s'', but it doesn''t.', text, subtext); end diff --git a/tests/test_MOcovMFile_recognizes_classdef_syntax.m b/tests/test_MOcovMFile_recognizes_classdef_syntax.m index a77844e..27e8bab 100644 --- a/tests/test_MOcovMFile_recognizes_classdef_syntax.m +++ b/tests/test_MOcovMFile_recognizes_classdef_syntax.m @@ -89,9 +89,16 @@ mfile = MOcovMFile(tempfile); lines = get_lines(mfile); executable_lines = get_lines_executable(mfile); - properties_lines = [3, 6]; + properties_opening = [2, 5]; + properties_body = [3, 6]; - for n = properties_lines + for n = properties_opening + assertStringContains(lines{n}, 'properties'); + assert(~executable_lines(n), ... + '`%s` line is wrongly classified as executable', lines{n}); + end + + for n = properties_body; assertStringContains(lines{n}, 'Prop;'); assert(~executable_lines(n), ... '`%s` line is wrongly classified as executable', lines{n});