These comparisons are shown for example only. There are other
constraints that might better handle the particular comparisons.
Create a test case for interactive testing.
Verify that the ReturnsTrue
constraint
is satisfied by the value returned by a handle to true
.
Interactive verification passed.
Verify that the ReturnsTrue
constraint
is not satisfied by a handle to false
.
Interactive verification failed.
---------------------
Framework Diagnostic:
---------------------
ReturnsTrue failed.
--> The function handle should have evaluated to "true".
--> Returned value:
0
Actual Function Handle:
@false
Verify that a call to isequal
returns
true.
Interactive verification passed.
Verify that a function that returns a double-valued 1
does not satisfy the ReturnsTrue
constraint.
Interactive verification failed.
---------------------
Framework Diagnostic:
---------------------
ReturnsTrue failed.
--> The function handle should have returned a logical value. It was of type "double".
--> Returned value:
1
Actual Function Handle:
@()double(true)
Verify that the negation of a text comparison of 'a'
and 'b'
returns
true.
Interactive verification passed.
Test if a comparison of 'a'
to the
cell array {'a','a'}
returns true.
Interactive verification failed.
---------------------
Framework Diagnostic:
---------------------
ReturnsTrue failed.
--> The function handle should have returned a scalar. The return value had a size of [1 2].
--> Returned value:
1 1
Actual Function Handle:
@()strcmp('a',{'a','a'})
The constraint is not satisfied because the call to strcmp
results
a logical array, not a logical scalar.