matlabtest.constraints.EqualsBaseline Class
Namespace: matlabtest.constraints
Superclasses: matlab.unittest.constraints.Constraint
Description
The matlabtest.constraints.EqualsBaseline
class provides a constraint to test for equality in
baseline tests. The constraint compares values in the same way as the IsEqualTo
constraint.
You can use the EqualsBaseline
constraint within a test class that
specifies baseline parameters. If the qualification fails, the testing framework provides you
with options to either create new baseline data or update the existing baseline data using the
actual value. For more information about baseline testing, see Create Baseline Tests for MATLAB Code.
Creation
Description
constraint = matlabtest.constraints.EqualsBaseline(
creates a constraint to test if the actual value is equal to the baseline data. The
constraint is satisfied if the actual value is strictly equal to the baseline data
represented by baseline
)baseline
.
constraint = matlabtest.constraints.EqualsBaseline(
uses the specified tolerance when testing for equality. For example, baseline
,Within=tol
)constraint =
matlabtest.constraints.EqualsBaseline(baseline,Within=matlab.unittest.constraints.RelativeTolerance(0.01))
creates a constraint to test if the difference between the corresponding elements of the
actual and baseline numeric arrays is within 1%. For more information about comparison
using a tolerance, see Comparison Details.
Input Arguments
Properties
Examples
Version History
Introduced in R2024b
See Also
Functions
Classes
matlabtest.parameters.BaselineParameter
|matlabtest.baselines.MATFileBaseline
|matlab.unittest.constraints.Tolerance
|matlab.unittest.constraints.IsEqualTo