Skip to content

Commit cc03693

Browse files
committed
update expected error ID in tests
1 parent fb12908 commit cc03693

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/autotrace_examples/example1/generate_data.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
% Copyright 2024 The MathWorks, Inc.
55

6+
% check input is valid
7+
if ~(isnumeric(n) && isscalar(n))
8+
error("autotrace_examples:example1:generate_data:InvalidN", ...
9+
"Input must be a numeric scalar");
10+
end
11+
612
% generate some random data
713
a = 1.5;
814
b = 0.8;

test/tautotrace.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function testError(testCase)
166166
at = opentelemetry.autoinstrument.AutoTrace(@example1);
167167

168168
% run the example with an invalid input, check for error
169-
verifyError(testCase, @()beginTrace(at, "invalid"), "MATLAB:colon:inputsMustBeNumericCharLogical");
169+
verifyError(testCase, @()beginTrace(at, "invalid"), "autotrace_examples:example1:generate_data:InvalidN");
170170

171171
% perform test comparisons
172172
results = readJsonResults(testCase);
@@ -195,7 +195,7 @@ function testHandleError(testCase)
195195

196196
% call example directly instead of calling beginTrace, and pass
197197
% in an invalid input
198-
verifyError(testCase, @()example1_trycatch(at, "invalid"), "MATLAB:colon:inputsMustBeNumericCharLogical");
198+
verifyError(testCase, @()example1_trycatch(at, "invalid"), "autotrace_examples:example1:generate_data:InvalidN");
199199

200200
% perform test comparisons
201201
results = readJsonResults(testCase);

0 commit comments

Comments
 (0)