diff --git a/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelFlowTest.kt b/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelFlowTest.kt index 1c05b77857..173db7e738 100644 --- a/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelFlowTest.kt +++ b/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelFlowTest.kt @@ -32,6 +32,7 @@ import com.vitorpamplona.quartz.nip52Calendar.appt.time.CalendarTimeSlotEvent import com.vitorpamplona.quartz.nip52Calendar.calendar.CalendarEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.StateFlow @@ -65,6 +66,7 @@ import org.junit.Test * `LocalCache` is a process-wide object and JUnit's method order is hash-based, so every method * uses its own author key and asserts only over that key's events. */ +@OptIn(ExperimentalCoroutinesApi::class) class CalendarsViewModelFlowTest { // viewModelScope is Dispatchers.Main, and every flow is a WhileSubscribed stateIn, so nothing // runs until something subscribes. diff --git a/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelTest.kt b/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelTest.kt index 389b3ef5aa..770e0add94 100644 --- a/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelTest.kt +++ b/amethyst/src/test/java/com/vitorpamplona/amethyst/calendar/CalendarsViewModelTest.kt @@ -26,6 +26,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.CalendarsViewMode import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.CalendarsViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars.startOfWeek import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.resetMain import kotlinx.coroutines.test.setMain import org.junit.After @@ -41,6 +42,7 @@ import java.time.YearMonth * The paging arithmetic the calendar lenses share, now that it lives on the screen's ViewModel * instead of being spelled out in each view's click handlers. */ +@OptIn(ExperimentalCoroutinesApi::class) class CalendarsViewModelTest { // The model's derived flows are `stateIn(viewModelScope, …)`, and stateIn launches its // sharing coroutine as soon as the property initializer runs — so simply CONSTRUCTING the