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

Replace FlowAssert with Turbine #1863

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions extensions/coroutines-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kotlin {
implementation deps.kotlin.test.common
implementation deps.kotlin.test.commonAnnotations
implementation deps.stately.collections
implementation deps.turbine
}
}
jvmMain {
Expand Down Expand Up @@ -54,6 +55,11 @@ kotlin {
nativeTest {
dependencies {
implementation project(':drivers:native-driver')
implementation(deps.kotlin.coroutines.native) {
version {
strictly("${versions.kotlinCoroutines}-native-mt")
Copy link
Member Author

Choose a reason for hiding this comment

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

Turbine depends on 1.3.8 which will override the native-mt use without this

}
}
}
}
}
Expand Down Expand Up @@ -85,6 +91,13 @@ kotlin {
kotlinOptions.freeCompilerArgs += ['-linker-options', '-lsqlite3']
}
}

sourceSets.matching { it.name.endsWith("Test") }.all {
it.languageSettings {
useExperimentalAnnotation('kotlin.time.ExperimentalTime')
useExperimentalAnnotation('kotlinx.coroutines.ExperimentalCoroutinesApi')
}
}
}

apply from: "$rootDir/gradle/gradle-mvn-push.gradle"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.squareup.sqldelight.runtime.coroutines

import app.cash.turbine.test
import com.squareup.sqldelight.Query
import com.squareup.sqldelight.internal.copyOnWriteList
import com.squareup.sqldelight.runtime.coroutines.Employee.Companion.MAPPER
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.squareup.sqldelight.runtime.coroutines

import app.cash.turbine.test
import com.squareup.sqldelight.runtime.coroutines.Employee.Companion.MAPPER
import com.squareup.sqldelight.runtime.coroutines.Employee.Companion.SELECT_EMPLOYEES
import com.squareup.sqldelight.runtime.coroutines.Employee.Companion.USERNAME
Expand All @@ -9,6 +10,7 @@ import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlinx.coroutines.flow.zip
import kotlinx.coroutines.yield

class QueryAsFlowTest {
private lateinit var db: TestDb
Expand Down Expand Up @@ -70,7 +72,8 @@ class QueryAsFlowTest {
cancel()

db.employee(Employee("john", "John Johnson"))
expectNoMoreEvents()
yield() // Ensure any events can be delivered.
expectNoEvents()
}
}

Expand Down
1 change: 1 addition & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ext.deps = [
kotlinPoet: 'com.squareup:kotlinpoet:1.5.0',
junit: 'junit:junit:4.12',
truth: 'com.google.truth:truth:0.42',
turbine: 'app.cash.turbine:turbine:0.1.0',
bugsnag: 'com.bugsnag:bugsnag:2.0.0',
intellijCore: fileTree(dir: "$rootDir/lib/intellij-core/lib", include: [
'idea.jar', 'openapi.jar', 'util.jar', 'trove4j.jar', 'extensions.jar',
Expand Down