Updated on 2026-08-14
This commit is contained in:
parent
1edb4eddc0
commit
6b25de35e5
2 changed files with 2 additions and 31 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue