Describe the bug
If a postcondition defined for a query operation uses the keyword result to check the result of the query operation, the evaluation fails.
To Reproduce
Load the following USE-model:
model PostConditionFailure
class A
operations
foo():String = 'A static string'
post postConditionValid: result = 'A static string'
post postAlwaysInvalid: result = 'Something else'
end
Afterwards execute the follwing commands:
!create a:A
?a.foo()
USE will not complain about the invalid postcondition. Instead it will output -> 'A static string' : String.
Expected behavior
USE must report the violation of the postcondition.
Additional context
Currently, the evaluation of the postcondition raises an exception which is silently catched and ignored.
See: MSystem::exitQueryOperation(...)
Describe the bug If a postcondition defined for a query operation uses the keyword
result
to check the result of the query operation, the evaluation fails.To Reproduce Load the following USE-model:
Afterwards execute the follwing commands:
USE will not complain about the invalid postcondition. Instead it will output
-> 'A static string' : String
.Expected behavior USE must report the violation of the postcondition.
Additional context Currently, the evaluation of the postcondition raises an exception which is silently catched and ignored. See:
MSystem::exitQueryOperation(...)