Updated on 2026-08-14

This commit is contained in:
Tangem 2020-06-08 12:41:16 +03:00
parent 1edb4eddc0
commit 6b25de35e5
2 changed files with 2 additions and 31 deletions

View file

@ -23,8 +23,8 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
// tests
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
testImplementation "com.google.truth:truth:1.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testImplementation "com.google.truth:truth:1.0.1"
}
sourceCompatibility = "8"

View file

@ -56,33 +56,4 @@ class CommandApduTest {
assertThat(commandApdu.apduData)
.isEqualTo(expected)
}
@Test
fun testFlow() {
val channel = BroadcastChannel<Int>(1)
val flow = GlobalScope.launch {
delay(100)
channel.send(1)
delay(200)
channel.send(2)
}
val scope = CoroutineScope(Dispatchers.IO)
val scope2 = CoroutineScope(Dispatchers.IO)
val receiveChannel1 = BroadcastChannel<Int>(1)
val receiveChannel2 = BroadcastChannel<Int>(1)
scope.launch {
channel.asFlow().collect { println(it) }
channel.asFlow().collect { println(it) }
}
scope.launch { channel.asFlow().collect { println(it) } }
runBlocking {
delay(1000)
}
}
}