Skip to content

Commit 7c10b22

Browse files
committed
move fatalAssertion failure to a new file so it runs at the end
1 parent 58550a6 commit 7c10b22

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

sample/TheTruth.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,5 @@ function testAssertionFailure(testCase)
2020
testCase.assertEqual(1+1, 11);
2121
testCase.assertEqual(1+1, 11);
2222
end
23-
24-
function testFatalAssertionFailure(testCase)
25-
testCase.fatalAssertEqual(1+1, 11);
26-
end
27-
28-
function testNotRun(testCase)
29-
onetyone = 11;
30-
testCase.verifyEqual(onetyone, 11);
31-
end
3223
end
3324
end

sample/ValidationTest.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% Named ValidationTest to run at the end of the suite
2+
% because it contains a fatal assertion failure.
3+
classdef ValidationTest < matlab.unittest.TestCase
4+
methods (Test)
5+
function testFatalAssertionFailure(testCase)
6+
testCase.fatalAssertEqual(1+1, 11);
7+
end
8+
9+
function testNotRun(testCase)
10+
onetyone = 11;
11+
testCase.verifyEqual(onetyone, 11);
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)