key
key copied to clipboard
TestTacletEquality ignores semantic switches
Description
While working on #3353, I noticed that changes inside of semantic switches in taclets are ignored.
For example, consider the following taclet:
assignmentMultiplicationInt {
\find(\modality{#normalassign}{..
#loc = #seCharByteShortInt0 * #seCharByteShortInt1;
...}\endmodality (post))
(intRules:arithmeticSemanticsCheckingOF) {
"Overflow check":
\add(==> inInt(mul(#seCharByteShortInt0, #seCharByteShortInt1)))
};
\replacewith({#loc := javaMulInt(#seCharByteShortInt0, #seCharByteShortInt1)}
\modality{#normalassign}{.. ...}\endmodality (post))
\heuristics(executeIntegerAssignment)
\displayname "multiplication"
};
Compare the corresponding entry in the taclets.old.txt:
== assignmentMultiplicationInt (multiplication) =========================================
assignmentMultiplicationInt {
\find(#normalassign ((modal operator))|{{ ..
#loc = #seCharByteShortInt0 * #seCharByteShortInt1;
... }}| (post))
\replacewith(update-application(elem-update(#loc (program Variable))(javaMulInt(#seCharByteShortInt0,#seCharByteShortInt1)),#normalassign(post)))
\heuristics(executeIntegerAssignment)
Choices: programRules:Java}
Note that the part with the semantics switch
(intRules:arithmeticSemanticsCheckingOF) {
"Overflow check":
\add(==> inInt(mul(#seCharByteShortInt0, #seCharByteShortInt1)))
};
does not occur at all. Thus, changes here are not correctly detected.
Reproducible
always
Steps to reproduce
- Change something inside the semantics switch of the taclet mentioned above.
- Generate a new oracle file "taclets.new.txt" by running the method
TestTacletEquality::createNewOracle
and rename it to taclets.old.txt.
The file is identical to the old version, instead of correctly reflecting the changed taclet.