Fix equality for generated test files.
They were compared based on the name of the file only disregarding the module. Therefore, the test framework would only patch package declarations for one file with a given name even if there were multiple files with that name in different packages.
This commit is contained in:
+6
-2
@@ -756,8 +756,12 @@ private class ExtTestDataFileStructureFactory(parentDisposable: Disposable) : Te
|
||||
module.files += this
|
||||
}
|
||||
|
||||
override fun equals(other: Any?) = (other as? ExtTestFile)?.name == name
|
||||
override fun hashCode() = name.hashCode()
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is ExtTestFile) return false
|
||||
return other.name == name && other.module == module
|
||||
}
|
||||
|
||||
override fun hashCode() = name.hashCode() * 31 + module.hashCode()
|
||||
}
|
||||
|
||||
private class ExtTestFileFactory : TestFiles.TestFileFactory<ExtTestModule, ExtTestFile> {
|
||||
|
||||
Reference in New Issue
Block a user