Permalink
Browse files

ENH: Bring back 'properties' opening check.

  • Loading branch information...
1 parent e176377 commit 08c3ba1364e48e0669a4307bc553acb3b3b5e299 Anderson Bravalheri committed with (none) Dec 20, 2016
Showing with 10 additions and 4 deletions.
  1. +1 −2 tests/support/assertStringContains.m
  2. +9 −2 tests/test_MOcovMFile_recognizes_classdef_syntax.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
@@ -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});

0 comments on commit 08c3ba1

Please sign in to comment.