Configure search suggestions
This commit is contained in:
@@ -9,14 +9,15 @@ import kotlinx.coroutines.withTimeoutOrNull
|
||||
import kotlinx.coroutines.yield
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
import org.koitharu.kotatsu.core.util.CompositeMutex
|
||||
import org.koitharu.kotatsu.core.util.MultiMutex
|
||||
|
||||
class CompositeMutexTest {
|
||||
class MultiMutexTest {
|
||||
|
||||
@Test
|
||||
fun singleLock() = runTest {
|
||||
val mutex = CompositeMutex<Int>()
|
||||
val mutex = MultiMutex<Int>()
|
||||
mutex.lock(1)
|
||||
mutex.lock(2)
|
||||
mutex.unlock(1)
|
||||
@@ -26,8 +27,9 @@ class CompositeMutexTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Cannot delay in test")
|
||||
fun doubleLock() = runTest {
|
||||
val mutex = CompositeMutex<Int>()
|
||||
val mutex = MultiMutex<Int>()
|
||||
repeat(2) {
|
||||
launch(Dispatchers.Default) {
|
||||
mutex.lock(1)
|
||||
@@ -44,7 +46,7 @@ class CompositeMutexTest {
|
||||
|
||||
@Test
|
||||
fun cancellation() = runTest {
|
||||
val mutex = CompositeMutex<Int>()
|
||||
val mutex = MultiMutex<Int>()
|
||||
mutex.lock(1)
|
||||
val job = launch {
|
||||
try {
|
||||
Reference in New Issue
Block a user