Skip to content

Commit 576b134

Browse files
HanSur94claude
andcommitted
test(1013-01): add TestLegacyClassesRemoved.m contract guard (DIFF-03)
- New tests/suite/TestLegacyClassesRemoved.m (~34 LOC). - Parameterized over the 11 legacy classes deleted across v2.0 (Phase 1011: Threshold, CompositeThreshold, StateChannel, ThresholdRule, Sensor, SensorRegistry, ThresholdRegistry, ExternalSensorRegistry) and v2.1 (Phase 1013: EventDetector, IncrementalEventDetector, EventConfig). - Asserts exist(ClassName, 'class') == 0 for each -- accidental re-introduction (revert, copy-paste, future contributor) fires a focused failure naming the leaking class. - Auto-discovered by tests/run_all_tests.m via TestSuite.fromFolder -- no runner edit needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c5a1373 commit 576b134

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
classdef TestLegacyClassesRemoved < matlab.unittest.TestCase
2+
%TESTLEGACYCLASSESREMOVED Regression-guard contract test for v2.1 deletion.
3+
%
4+
% Asserts that the 11 legacy classes deleted across Phase 1011 (v2.0)
5+
% and Phase 1013 (v2.1) are NOT reachable on the MATLAB path after
6+
% install(). Re-introduction of any of these names -- by accidental
7+
% git revert, careless copy-paste, or a future contributor unaware of
8+
% the v2.0/v2.1 cleanup -- fires a fast, focused failure here.
9+
%
10+
% This is a STATIC contract test, not a behavioral one. It runs in
11+
% ~milliseconds and adds no runtime cost to the suite.
12+
%
13+
% See also TestGoldenIntegration (the v2.0 behavioral regression guard).
14+
15+
properties (TestParameter)
16+
ClassName = {'EventDetector', 'IncrementalEventDetector', 'EventConfig', ...
17+
'Threshold', 'CompositeThreshold', 'StateChannel', 'ThresholdRule', ...
18+
'Sensor', 'SensorRegistry', 'ThresholdRegistry', 'ExternalSensorRegistry'};
19+
end
20+
21+
methods (TestClassSetup)
22+
function addPaths(testCase) %#ok<MANU>
23+
addpath(fullfile(fileparts(mfilename('fullpath')), '..', '..'));
24+
install();
25+
end
26+
end
27+
28+
methods (Test)
29+
function classIsAbsent(testCase, ClassName)
30+
testCase.verifyEqual(exist(ClassName, 'class'), 0, ...
31+
sprintf('Legacy class %s should not be reachable; was deleted in Phase 1011 (v2.0) or Phase 1013 (v2.1).', ClassName));
32+
end
33+
end
34+
end

0 commit comments

Comments
 (0)