Skip to content

Commit

Permalink
assertSame is used on each depth of deepEquals
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorkaKulikov committed Oct 4, 2023
1 parent 6626808 commit 883af21
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
visitedModels += modelWithField

with(testFrameworkManager) {
if (expectedModel.isMockModel()) {
currentBlock += assertions[assertSame](expected, actual).toStatement()
return
}

if (depth >= DEEP_EQUALS_MAX_DEPTH) {
currentBlock += CgSingleLineComment("Current deep equals depth exceeds max depth $DEEP_EQUALS_MAX_DEPTH")
currentBlock += getDeepEqualsAssertion(expected, actual).toStatement()
Expand Down Expand Up @@ -1226,12 +1231,7 @@ open class CgMethodConstructor(val context: CgContext) : CgContextOwner by conte
if (!successfullyConstructedCustomAssert) {
val expectedVariable = variableConstructor.getOrCreateVariable(expected, expectedVariableName)
if (emptyLineIfNeeded) emptyLineIfNeeded()

if (expected.isMockModel()) {
testFrameworkManager.assertSame(expectedVariable, actual)
} else {
assertEquality(expectedVariable, actual)
}
assertEquality(expectedVariable, actual)
}
}

Expand Down

0 comments on commit 883af21

Please sign in to comment.