Merge pull request #5638 from element-hq/feature/bma/upgradeKtLint
Upgrade ktlint to 1.7.1 and ensure Renovate will upgrade the version
This commit is contained in:
commit
e8b7db22cd
15 changed files with 67 additions and 54 deletions
|
|
@ -26,7 +26,11 @@ ktlint_standard_annotation = disabled
|
||||||
ktlint_standard_parameter-list-wrapping = disabled
|
ktlint_standard_parameter-list-wrapping = disabled
|
||||||
ktlint_standard_indent = disabled
|
ktlint_standard_indent = disabled
|
||||||
ktlint_standard_blank-line-before-declaration = disabled
|
ktlint_standard_blank-line-before-declaration = disabled
|
||||||
ktlint_function_naming_ignore_when_annotated_with=Composable
|
ktlint_function_naming_ignore_when_annotated_with = Composable
|
||||||
|
# Added when upgrading to 1.7.1
|
||||||
|
ktlint_standard_function-expression-body = disabled
|
||||||
|
ktlint_standard_chain-method-continuation = disabled
|
||||||
|
ktlint_standard_class-signature = disabled
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
ij_java_align_consecutive_assignments = false
|
ij_java_align_consecutive_assignments = false
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import org.gradle.accessors.dm.LibrariesForLibs
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2022-2024 New Vector Ltd.
|
* Copyright 2022-2024 New Vector Ltd.
|
||||||
*
|
*
|
||||||
|
|
@ -27,6 +29,8 @@ tasks.register<Delete>("clean").configure {
|
||||||
delete(rootProject.layout.buildDirectory)
|
delete(rootProject.layout.buildDirectory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val ktLintVersion = the<LibrariesForLibs>().versions.ktlint.get()
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
// Detekt
|
// Detekt
|
||||||
apply {
|
apply {
|
||||||
|
|
@ -56,14 +60,12 @@ allprojects {
|
||||||
|
|
||||||
// See https://github.com/JLLeitschuh/ktlint-gradle#configuration
|
// See https://github.com/JLLeitschuh/ktlint-gradle#configuration
|
||||||
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
|
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
|
||||||
// See https://github.com/pinterest/ktlint/releases/
|
version = ktLintVersion
|
||||||
// TODO Regularly check for new version here ^
|
android = true
|
||||||
version.set("1.1.1")
|
ignoreFailures = false
|
||||||
android.set(true)
|
enableExperimentalRules = true
|
||||||
ignoreFailures.set(false)
|
|
||||||
enableExperimentalRules.set(true)
|
|
||||||
// display the corresponding rule
|
// display the corresponding rule
|
||||||
verbose.set(true)
|
verbose = true
|
||||||
reporters {
|
reporters {
|
||||||
reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN)
|
reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN)
|
||||||
// To have XML report for Danger
|
// To have XML report for Danger
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,10 @@ class HomeFlowNode(
|
||||||
analyticsService.screen(MobileScreen(screenName = MobileScreen.ScreenName.Home))
|
analyticsService.screen(MobileScreen(screenName = MobileScreen.ScreenName.Home))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
whenChildAttached { commonLifecycle: Lifecycle,
|
whenChildAttached {
|
||||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy ->
|
commonLifecycle: Lifecycle,
|
||||||
|
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy,
|
||||||
|
->
|
||||||
commonLifecycle.coroutineScope.launch {
|
commonLifecycle.coroutineScope.launch {
|
||||||
changeRoomMemberRolesNode.waitForRoleChanged()
|
changeRoomMemberRolesNode.waitForRoleChanged()
|
||||||
withContext(NonCancellable) {
|
withContext(NonCancellable) {
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,14 @@ class DefaultDeclineInviteTest {
|
||||||
private val notificationCleaner =
|
private val notificationCleaner =
|
||||||
FakeNotificationCleaner(clearMembershipNotificationForRoomLambda = clearMembershipNotificationForRoomLambda)
|
FakeNotificationCleaner(clearMembershipNotificationForRoomLambda = clearMembershipNotificationForRoomLambda)
|
||||||
|
|
||||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { -> Result.success(Unit) }
|
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||||
private val successIgnoreUserLambda =
|
private val successIgnoreUserLambda =
|
||||||
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.success(Unit) }
|
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.success(Unit) }
|
||||||
private val successReportRoomLambda =
|
private val successReportRoomLambda =
|
||||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
||||||
|
|
||||||
private val failureLeaveRoomLambda =
|
private val failureLeaveRoomLambda =
|
||||||
lambdaRecorder<Result<Unit>> { -> Result.failure(Exception("Leave room error")) }
|
lambdaRecorder<Result<Unit>> { Result.failure(Exception("Leave room error")) }
|
||||||
private val failureIgnoreUserLambda =
|
private val failureIgnoreUserLambda =
|
||||||
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.failure(Exception("Ignore user error")) }
|
lambdaRecorder<UserId, Result<Unit>> { _ -> Result.failure(Exception("Ignore user error")) }
|
||||||
private val failureReportRoomLambda =
|
private val failureReportRoomLambda =
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@ import org.junit.Test
|
||||||
|
|
||||||
class DefaultReportRoomTest {
|
class DefaultReportRoomTest {
|
||||||
private val roomId = A_ROOM_ID
|
private val roomId = A_ROOM_ID
|
||||||
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { -> Result.success(Unit) }
|
private val successLeaveRoomLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||||
private val successReportRoomLambda =
|
private val successReportRoomLambda =
|
||||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
lambdaRecorder<String?, Result<Unit>> { _ -> Result.success(Unit) }
|
||||||
|
|
||||||
private val failureLeaveRoomLambda =
|
private val failureLeaveRoomLambda =
|
||||||
lambdaRecorder<Result<Unit>> { -> Result.failure(Exception("Leave room error")) }
|
lambdaRecorder<Result<Unit>> { Result.failure(Exception("Leave room error")) }
|
||||||
private val failureReportRoomLambda =
|
private val failureReportRoomLambda =
|
||||||
lambdaRecorder<String?, Result<Unit>> { _ -> Result.failure(Exception("Report room error")) }
|
lambdaRecorder<String?, Result<Unit>> { _ -> Result.failure(Exception("Report room error")) }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,11 @@ class RoomDetailsFlowNode(
|
||||||
|
|
||||||
override fun onBuilt() {
|
override fun onBuilt() {
|
||||||
super.onBuilt()
|
super.onBuilt()
|
||||||
whenChildrenAttached { commonLifecycle: Lifecycle,
|
whenChildrenAttached {
|
||||||
roomDetailsNode: RoomDetailsNode,
|
commonLifecycle: Lifecycle,
|
||||||
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy ->
|
roomDetailsNode: RoomDetailsNode,
|
||||||
|
changeRoomMemberRolesNode: ChangeRoomMemberRolesEntryPoint.NodeProxy,
|
||||||
|
->
|
||||||
commonLifecycle.coroutineScope.launch {
|
commonLifecycle.coroutineScope.launch {
|
||||||
changeRoomMemberRolesNode.waitForRoleChanged()
|
changeRoomMemberRolesNode.waitForRoleChanged()
|
||||||
withContext(NonCancellable) {
|
withContext(NonCancellable) {
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,7 @@ class RoomDirectoryPresenterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - emit load more event`() = runTest {
|
fun `present - emit load more event`() = runTest {
|
||||||
val loadMoreLambda = lambdaRecorder { ->
|
val loadMoreLambda = lambdaRecorder<Result<Unit>> { Result.success(Unit) }
|
||||||
Result.success(Unit)
|
|
||||||
}
|
|
||||||
val roomDirectoryList = FakeRoomDirectoryList(loadMoreLambda = loadMoreLambda)
|
val roomDirectoryList = FakeRoomDirectoryList(loadMoreLambda = loadMoreLambda)
|
||||||
val roomDirectoryService = FakeRoomDirectoryService { roomDirectoryList }
|
val roomDirectoryService = FakeRoomDirectoryService { roomDirectoryList }
|
||||||
val presenter = createRoomDirectoryPresenter(roomDirectoryService = roomDirectoryService)
|
val presenter = createRoomDirectoryPresenter(roomDirectoryService = roomDirectoryService)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ datetime = "0.7.1"
|
||||||
serialization_json = "1.9.0"
|
serialization_json = "1.9.0"
|
||||||
|
|
||||||
#other
|
#other
|
||||||
detekt = "1.23.8"
|
|
||||||
coil = "3.3.0"
|
coil = "3.3.0"
|
||||||
showkase = "1.0.5"
|
showkase = "1.0.5"
|
||||||
appyx = "1.7.1"
|
appyx = "1.7.1"
|
||||||
|
|
@ -59,6 +58,9 @@ metro = "0.7.2"
|
||||||
autoservice = "1.1.1"
|
autoservice = "1.1.1"
|
||||||
|
|
||||||
# quality
|
# quality
|
||||||
|
detekt = "1.23.8"
|
||||||
|
# See https://github.com/pinterest/ktlint/releases/
|
||||||
|
ktlint = "1.7.1"
|
||||||
androidx-test-ext-junit = "1.3.0"
|
androidx-test-ext-junit = "1.3.0"
|
||||||
kover = "0.9.1"
|
kover = "0.9.1"
|
||||||
|
|
||||||
|
|
@ -148,6 +150,10 @@ network_retrofit_bom = "com.squareup.retrofit2:retrofit-bom:3.0.0"
|
||||||
network_retrofit = { module = "com.squareup.retrofit2:retrofit" }
|
network_retrofit = { module = "com.squareup.retrofit2:retrofit" }
|
||||||
network_retrofit_converter_serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization" }
|
network_retrofit_converter_serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization" }
|
||||||
|
|
||||||
|
# Quality
|
||||||
|
# Reference ktlint-cli so that Renovate can check if a new version is available.
|
||||||
|
ktlint-cli = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint" }
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
test_core = { module = "androidx.test:core", version.ref = "test_core" }
|
test_core = { module = "androidx.test:core", version.ref = "test_core" }
|
||||||
test_corektx = { module = "androidx.test:core-ktx", version.ref = "test_core" }
|
test_corektx = { module = "androidx.test:core-ktx", version.ref = "test_core" }
|
||||||
|
|
|
||||||
|
|
@ -75,22 +75,21 @@ class AsyncDataKtTest {
|
||||||
private class TestableMutableState<T>(
|
private class TestableMutableState<T>(
|
||||||
value: T
|
value: T
|
||||||
) : MutableState<T> {
|
) : MutableState<T> {
|
||||||
@Suppress("ktlint:standard:property-naming")
|
private val deque = ArrayDeque(listOf(value))
|
||||||
private val _deque = ArrayDeque<T>(listOf(value))
|
|
||||||
|
|
||||||
override var value: T
|
override var value: T
|
||||||
get() = _deque.last()
|
get() = deque.last()
|
||||||
set(value) {
|
set(value) {
|
||||||
_deque.addLast(value)
|
deque.addLast(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the states that were set in the order they were set.
|
* Returns the states that were set in the order they were set.
|
||||||
*/
|
*/
|
||||||
fun popFirst(): T = _deque.removeFirst()
|
fun popFirst(): T = deque.removeFirst()
|
||||||
|
|
||||||
fun assertNoMoreValues() {
|
fun assertNoMoreValues() {
|
||||||
assertThat(_deque).isEmpty()
|
assertThat(deque).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
override operator fun component1(): T = value
|
override operator fun component1(): T = value
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import kotlinx.collections.immutable.toPersistentList
|
||||||
object WaveFormSamples {
|
object WaveFormSamples {
|
||||||
val allRangeWaveForm = List(100) { it.toFloat() / 100 }.toImmutableList()
|
val allRangeWaveForm = List(100) { it.toFloat() / 100 }.toImmutableList()
|
||||||
|
|
||||||
|
@Suppress("ktlint:standard:argument-list-wrapping")
|
||||||
val realisticWaveForm = persistentListOf(
|
val realisticWaveForm = persistentListOf(
|
||||||
0.000f, 0.000f, 0.000f, 0.003f, 0.354f,
|
0.000f, 0.000f, 0.000f, 0.003f, 0.354f,
|
||||||
0.353f, 0.365f, 0.790f, 0.787f, 0.167f,
|
0.353f, 0.365f, 0.790f, 0.787f, 0.167f,
|
||||||
|
|
|
||||||
|
|
@ -71,10 +71,7 @@ public fun MapLibreMap(
|
||||||
uiSettings: MapUiSettings = DefaultMapUiSettings,
|
uiSettings: MapUiSettings = DefaultMapUiSettings,
|
||||||
symbolManagerSettings: MapSymbolManagerSettings = DefaultMapSymbolManagerSettings,
|
symbolManagerSettings: MapSymbolManagerSettings = DefaultMapSymbolManagerSettings,
|
||||||
locationSettings: MapLocationSettings = DefaultMapLocationSettings,
|
locationSettings: MapLocationSettings = DefaultMapLocationSettings,
|
||||||
content: (
|
content: (@Composable @MapLibreMapComposable () -> Unit)? = null,
|
||||||
@Composable @MapLibreMapComposable
|
|
||||||
() -> Unit
|
|
||||||
)? = null,
|
|
||||||
) {
|
) {
|
||||||
// When in preview, early return a Box with the received modifier preserving layout
|
// When in preview, early return a Box with the received modifier preserving layout
|
||||||
if (LocalInspectionMode.current) {
|
if (LocalInspectionMode.current) {
|
||||||
|
|
|
||||||
|
|
@ -207,10 +207,12 @@ class RustTimeline(
|
||||||
backwardPaginationStatus,
|
backwardPaginationStatus,
|
||||||
forwardPaginationStatus,
|
forwardPaginationStatus,
|
||||||
joinedRoom.roomInfoFlow.map { it.creators to it.isDm }.distinctUntilChanged(),
|
joinedRoom.roomInfoFlow.map { it.creators to it.isDm }.distinctUntilChanged(),
|
||||||
) { timelineItems,
|
) {
|
||||||
|
timelineItems,
|
||||||
backwardPaginationStatus,
|
backwardPaginationStatus,
|
||||||
forwardPaginationStatus,
|
forwardPaginationStatus,
|
||||||
(roomCreators, isDm) ->
|
(roomCreators, isDm),
|
||||||
|
->
|
||||||
withContext(dispatcher) {
|
withContext(dispatcher) {
|
||||||
timelineItems
|
timelineItems
|
||||||
.let { items ->
|
.let { items ->
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class FakeNotificationCreator(
|
||||||
var createFallbackNotificationResult: LambdaOneParamRecorder<FallbackNotifiableEvent, Notification> = lambdaRecorder { _ -> A_NOTIFICATION },
|
var createFallbackNotificationResult: LambdaOneParamRecorder<FallbackNotifiableEvent, Notification> = lambdaRecorder { _ -> A_NOTIFICATION },
|
||||||
var createSummaryListNotificationResult: LambdaFourParamsRecorder<MatrixUser, String, Boolean, Long, Notification> =
|
var createSummaryListNotificationResult: LambdaFourParamsRecorder<MatrixUser, String, Boolean, Long, Notification> =
|
||||||
lambdaRecorder { _, _, _, _ -> A_NOTIFICATION },
|
lambdaRecorder { _, _, _, _ -> A_NOTIFICATION },
|
||||||
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder { -> A_NOTIFICATION },
|
var createDiagnosticNotificationResult: LambdaNoParamRecorder<Notification> = lambdaRecorder<Notification> { A_NOTIFICATION },
|
||||||
) : NotificationCreator {
|
) : NotificationCreator {
|
||||||
override suspend fun createMessagesListNotification(
|
override suspend fun createMessagesListNotification(
|
||||||
roomInfo: RoomEventGroupInfo,
|
roomInfo: RoomEventGroupInfo,
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,3 @@ dependencies {
|
||||||
implementation(libs.test.core)
|
implementation(libs.test.core)
|
||||||
implementation(libs.test.turbine)
|
implementation(libs.test.turbine)
|
||||||
}
|
}
|
||||||
|
|
||||||
ktlint {
|
|
||||||
filter {
|
|
||||||
exclude { element ->
|
|
||||||
val path = element.file.path
|
|
||||||
// Exclude this file, that ktlint cannot parse.
|
|
||||||
path.contains("libraries/troubleshoot/test/src/main/kotlin/io/element/android/libraries/troubleshoot/test/Utils.kt")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
assertThat(player1.prepare().isSuccess).isTrue()
|
assertThat(player1.prepare().isSuccess).isTrue()
|
||||||
matchReadyState(1_000L)
|
matchReadyState(1_000L)
|
||||||
player1.play()
|
player1.play()
|
||||||
awaitItem().let { // it plays until the end.
|
awaitItem().let {
|
||||||
|
// it plays until the end.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isTrue()
|
assertThat(it.isEnded).isTrue()
|
||||||
|
|
@ -127,14 +128,16 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
player2.state.test {
|
player2.state.test {
|
||||||
matchInitialState()
|
matchInitialState()
|
||||||
assertThat(player2.prepare().isSuccess).isTrue()
|
assertThat(player2.prepare().isSuccess).isTrue()
|
||||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
awaitItem().let {
|
||||||
|
// Additional spurious state due to MediaPlayer owner change.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isTrue()
|
assertThat(it.isEnded).isTrue()
|
||||||
assertThat(it.currentPosition).isEqualTo(1000)
|
assertThat(it.currentPosition).isEqualTo(1000)
|
||||||
assertThat(it.duration).isEqualTo(1000)
|
assertThat(it.duration).isEqualTo(1000)
|
||||||
}
|
}
|
||||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
awaitItem().let {
|
||||||
|
// Additional spurious state due to MediaPlayer owner change.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isFalse()
|
assertThat(it.isEnded).isFalse()
|
||||||
|
|
@ -143,7 +146,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
}
|
}
|
||||||
matchReadyState(1_000L)
|
matchReadyState(1_000L)
|
||||||
player2.play()
|
player2.play()
|
||||||
awaitItem().let { // it plays until the end.
|
awaitItem().let {
|
||||||
|
// it plays until the end.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isTrue()
|
assertThat(it.isEnded).isTrue()
|
||||||
|
|
@ -154,7 +158,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
|
|
||||||
// Play player1 again.
|
// Play player1 again.
|
||||||
player1.state.test {
|
player1.state.test {
|
||||||
awaitItem().let { // Last previous state/
|
awaitItem().let {
|
||||||
|
// Last previous state/
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isTrue()
|
assertThat(it.isEnded).isTrue()
|
||||||
|
|
@ -162,7 +167,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
assertThat(it.duration).isEqualTo(1000)
|
assertThat(it.duration).isEqualTo(1000)
|
||||||
}
|
}
|
||||||
assertThat(player1.prepare().isSuccess).isTrue()
|
assertThat(player1.prepare().isSuccess).isTrue()
|
||||||
awaitItem().let { // Additional spurious state due to MediaPlayer owner change.
|
awaitItem().let {
|
||||||
|
// Additional spurious state due to MediaPlayer owner change.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isFalse()
|
assertThat(it.isEnded).isFalse()
|
||||||
|
|
@ -171,7 +177,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
}
|
}
|
||||||
matchReadyState(1_000L)
|
matchReadyState(1_000L)
|
||||||
player1.play()
|
player1.play()
|
||||||
awaitItem().let { // it played again until the end.
|
awaitItem().let {
|
||||||
|
// it played again until the end.
|
||||||
assertThat(it.isReady).isFalse()
|
assertThat(it.isReady).isFalse()
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
assertThat(it.isEnded).isTrue()
|
assertThat(it.isEnded).isTrue()
|
||||||
|
|
@ -189,7 +196,8 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
assertThat(player.prepare().isSuccess).isTrue()
|
assertThat(player.prepare().isSuccess).isTrue()
|
||||||
matchReadyState()
|
matchReadyState()
|
||||||
player.play()
|
player.play()
|
||||||
skipItems(1) // skip play state
|
// skip play state
|
||||||
|
skipItems(1)
|
||||||
player.pause()
|
player.pause()
|
||||||
awaitItem().let {
|
awaitItem().let {
|
||||||
assertThat(it.isPlaying).isFalse()
|
assertThat(it.isPlaying).isFalse()
|
||||||
|
|
@ -206,9 +214,11 @@ class DefaultVoiceMessagePlayerTest {
|
||||||
assertThat(player.prepare().isSuccess).isTrue()
|
assertThat(player.prepare().isSuccess).isTrue()
|
||||||
matchReadyState()
|
matchReadyState()
|
||||||
player.play()
|
player.play()
|
||||||
skipItems(1) // skip play state
|
// skip play state
|
||||||
|
skipItems(1)
|
||||||
player.pause()
|
player.pause()
|
||||||
skipItems(1) // skip pause state
|
// skip pause state
|
||||||
|
skipItems(1)
|
||||||
player.play()
|
player.play()
|
||||||
awaitItem().let {
|
awaitItem().let {
|
||||||
assertThat(it.isPlaying).isTrue()
|
assertThat(it.isPlaying).isTrue()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue