Skip to content

Commit e2ded77

Browse files
HanSur94claude
andcommitted
fix(merge): post-second-merge cleanup — Wiki Browser lint + 1x9 toolbar tests
Two failures appeared after the second merge from main brought in v4.0's Phase 1034 Wiki Browser (PR #159): 1. MATLAB Lint — libs/Help/WikiPageIndex.m had two operator_after_continuation style violations (`&& strncmp(...)` on a continuation line). Moved the operators to the end of the previous line. mh_style reports clean. 2. MATLAB Tests (E-I) — TestFastSenseCompanionPlantLogToolbar still expected the 1x8 toolbar grid from the prior merge. After the v4.0 Wiki button was inserted (now col 7), the grid is 1x9 and the gear moved from col 8 to col 9. Updated: - findToolbarGrid_ helper to look for 9-column ColumnWidth {110,110,110,130,70,90,70,'1x',36} - testToolbarGridIs1x5 (still called by that name for historical reasons) to assert col-by-col for all 9 columns - testSettingsButtonMovedToCol5 to expect col 9 Local: 11/11 pass on MATLAB R2025b. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5d23f3a commit e2ded77

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

libs/Help/WikiPageIndex.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181

8282
if strcmpi(filename, '_Sidebar.md')
8383
grp = 'Sidebar';
84-
elseif numel(filename) >= numel('API-Reference:-') ...
85-
&& strncmp(filename, 'API-Reference:-', numel('API-Reference:-'))
84+
elseif numel(filename) >= numel('API-Reference:-') && ...
85+
strncmp(filename, 'API-Reference:-', numel('API-Reference:-'))
8686
grp = 'API Reference';
8787
else
8888
grp = 'Pages';
@@ -381,8 +381,8 @@
381381
continue;
382382
end
383383
marker = '<!-- AUTO-GENERATED';
384-
if numel(line) >= numel(marker) ...
385-
&& strncmp(line, marker, numel(marker))
384+
if numel(line) >= numel(marker) && ...
385+
strncmp(line, marker, numel(marker))
386386
tf = true;
387387
end
388388
return;

tests/suite/TestFastSenseCompanionPlantLogToolbar.m

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,19 @@ function cleanupAll(testCase)
114114
end
115115

116116
function g = findToolbarGrid_(testCase, c) %#ok<INUSL>
117-
% After v3.1 + v4.0 merge, the Companion toolbar is a 1x8 grid:
118-
% {110, 110, 110, 130, 70, 90, '1x', 36}
117+
% After v3.1 Plant Log + v4.0 Wiki Browser merges, the
118+
% Companion toolbar is a 1x9 grid:
119+
% {110, 110, 110, 130, 70, 90, 70, '1x', 36}
119120
fig = c.getFigForTest_();
120121
grids = findobj(fig, 'Type', 'uigridlayout');
121122
g = [];
122123
for i = 1:numel(grids)
123-
if numel(grids(i).ColumnWidth) == 8
124+
if numel(grids(i).ColumnWidth) == 9
124125
cw = grids(i).ColumnWidth;
125126
if iscell(cw) && isequal(cw{1}, 110) && isequal(cw{2}, 110) && ...
126127
isequal(cw{3}, 110) && isequal(cw{4}, 130) && ...
127128
isequal(cw{5}, 70) && isequal(cw{6}, 90) && ...
128-
isequal(cw{8}, 36)
129+
isequal(cw{7}, 70) && isequal(cw{9}, 36)
129130
g = grids(i);
130131
return;
131132
end
@@ -138,15 +139,17 @@ function cleanupAll(testCase)
138139
methods (Test)
139140

140141
function testToolbarGridIs1x5(testCase)
141-
% v3.1 + v4.0 merged: toolbar grew from 1x4 to 1x8.
142+
% v3.1 Plant Log + v4.0 Wiki Browser merged: toolbar grew from
143+
% 1x4 to 1x9.
142144
% col 1 = Events (110)
143145
% col 2 = Live (110)
144146
% col 3 = Tags (110, v4.0 quick task 260519-bs4)
145147
% col 4 = Plant Log (130, v3.1 Phase 1033 PLOG-INT-03)
146148
% col 5 = Tile ( 70, v4.0 S0Y-01)
147149
% col 6 = Close all ( 90, v4.0 S0Y-02)
148-
% col 7 = flex spacer
149-
% col 8 = gear ( 36)
150+
% col 7 = Wiki ( 70, v4.0 Phase 1034)
151+
% col 8 = flex spacer
152+
% col 9 = gear ( 36)
150153
d1 = testCase.makeEngine_('A');
151154
c = testCase.makeCompanion_({d1});
152155
g = testCase.findToolbarGrid_(c);
@@ -159,8 +162,9 @@ function testToolbarGridIs1x5(testCase)
159162
testCase.verifyEqual(cw{4}, 130, 'ColumnWidth{4} (Plant Log, v3.1)');
160163
testCase.verifyEqual(cw{5}, 70, 'ColumnWidth{5} (Tile, v4.0)');
161164
testCase.verifyEqual(cw{6}, 90, 'ColumnWidth{6} (Close all, v4.0)');
162-
testCase.verifyEqual(cw{7}, '1x', 'ColumnWidth{7} flex spacer');
163-
testCase.verifyEqual(cw{8}, 36, 'ColumnWidth{8} (gear)');
165+
testCase.verifyEqual(cw{7}, 70, 'ColumnWidth{7} (Wiki, v4.0 Phase 1034)');
166+
testCase.verifyEqual(cw{8}, '1x', 'ColumnWidth{8} flex spacer');
167+
testCase.verifyEqual(cw{9}, 36, 'ColumnWidth{9} (gear)');
164168
end
165169

166170
function testPlantLogButtonExists(testCase)
@@ -212,8 +216,8 @@ function testSettingsButtonMovedToCol5(testCase)
212216
c = testCase.makeCompanion_({d1});
213217
gear = findobj(c.getFigForTest_(), 'Tooltip', 'Companion settings');
214218
testCase.verifyNotEmpty(gear);
215-
testCase.verifyEqual(gear.Layout.Column, 8, ...
216-
'settings gear must be at col 8 (1x8 grid post-merge: was col 4 pre-1033, col 5 v3.1-only, col 7 v4.0-only)');
219+
testCase.verifyEqual(gear.Layout.Column, 9, ...
220+
'settings gear must be at col 9 (1x9 grid post-v3.1+Wiki-Browser merge)');
217221
end
218222

219223
function testFindObjResolvesViaTag(testCase)

0 commit comments

Comments
 (0)