From 304cbf67b1d3e5d90caa0f811db0a680bce8733f Mon Sep 17 00:00:00 2001 From: Vyacheslav Tamarin Date: Thu, 9 Mar 2023 23:48:56 +0300 Subject: [PATCH] Fix state before - state after detection --- .../model/constructor/tree/PythonCgMethodConstructor.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/model/constructor/tree/PythonCgMethodConstructor.kt b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/model/constructor/tree/PythonCgMethodConstructor.kt index f1faa03a53..b9c143b4b1 100644 --- a/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/model/constructor/tree/PythonCgMethodConstructor.kt +++ b/utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/model/constructor/tree/PythonCgMethodConstructor.kt @@ -62,7 +62,7 @@ class PythonCgMethodConstructor(context: CgContext) : CgMethodConstructor(contex val afterThisInstance = execution.stateAfter.thisInstance val assertThisObject = emptyList>().toMutableList() if (beforeThisInstance is PythonTreeModel && afterThisInstance is PythonTreeModel) { - if (beforeThisInstance != afterThisInstance) { + if (PythonTreeWrapper(beforeThisInstance.tree) != PythonTreeWrapper(afterThisInstance.tree)) { thisInstance = thisInstance?.let { val newValue = if (it is CgPythonTree) { @@ -91,7 +91,7 @@ class PythonCgMethodConstructor(context: CgContext) : CgMethodConstructor(contex val afterValue = execution.stateAfter.parameters[index] if (afterValue is PythonTreeModel && param is PythonTreeModel) { - if (afterValue != param) { + if (PythonTreeWrapper(afterValue.tree) != PythonTreeWrapper(param.tree)) { if (argument !is CgVariable) { argument = newVar(argument.type, name) {argument} }