Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SyncConfig tests that would break on Windows #1518

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import io.realm.kotlin.entities.sync.flx.FlexChildObject
import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject
import io.realm.kotlin.entities.sync.flx.FlexParentObject
import io.realm.kotlin.ext.query
import io.realm.kotlin.internal.platform.PATH_SEPARATOR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Not for this PR, but unfortunate #naming ... File.pathSeparator is usually for separating multiple path entries and not the directory separator 🙃

import io.realm.kotlin.internal.platform.createDefaultSystemLogger
import io.realm.kotlin.internal.platform.runBlocking
import io.realm.kotlin.internal.platform.singleThreadDispatcher
Expand Down Expand Up @@ -406,7 +407,7 @@ class SyncConfigTests {

private fun verifyName(builder: SyncConfiguration.Builder, expectedFileName: String) {
val config = builder.build()
val suffix = "/mongodb-realm/${config.user.app.configuration.appId}/${config.user.identity}/$expectedFileName"
val suffix = "${PATH_SEPARATOR}mongodb-realm${PATH_SEPARATOR}${config.user.app.configuration.appId}${PATH_SEPARATOR}${config.user.id}${PATH_SEPARATOR}$expectedFileName"
cmelchior marked this conversation as resolved.
Show resolved Hide resolved
assertTrue(config.path.contains(suffix), "${config.path} failed.")
assertEquals(expectedFileName, config.name)
}
Expand Down Expand Up @@ -1260,7 +1261,7 @@ class SyncConfigTests {
val config: SyncConfiguration = SyncConfiguration.Builder(user, partitionValue, setOf())
.name(fileName)
.build()
val suffix = "/mongodb-realm/${user.app.configuration.appId}/${user.identity}/$fileName"
val suffix = "${PATH_SEPARATOR}mongodb-realm${PATH_SEPARATOR}${user.app.configuration.appId}${PATH_SEPARATOR}${user.id}${PATH_SEPARATOR}$fileName"
assertTrue(config.path.endsWith(suffix), "${config.path} failed.")
assertEquals(fileName, config.name, "${config.name} failed.")
}
Expand Down
Loading