Skip to content

Commit 85fa0ba

Browse files
authored
Avoid generating wrong enum assertions produced by engine bug #1672 (#1706)
1 parent 1d7ee31 commit 85fa0ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/CgMethodConstructor.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,13 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
552552
val beforeVariable = cache.before[path]?.variable
553553
val (afterVariable, afterModel) = cache.after[path]!!
554554

555+
// TODO: remove the following after the issue fix
556+
// We do not generate some assertions for Enums due to [https://github.com/UnitTestBot/UTBotJava/issues/1704].
557+
val beforeModel = cache.before[path]?.model
558+
if (beforeModel !is UtEnumConstantModel && afterModel is UtEnumConstantModel) {
559+
return
560+
}
561+
555562
if (afterModel !is UtReferenceModel) {
556563
val expectedAfter =
557564
variableConstructor.getOrCreateVariable(afterModel, "expected" + afterVariable.name.capitalize())

0 commit comments

Comments
 (0)