This repository was archived by the owner on Aug 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Library/src/test/java/com/shopify/testify Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 instrumentationTests :
2121 name : Instrumentation Tests
2222 runs-on : macos-latest
23+ timeout-minutes : 30
2324 steps :
2425
2526 - name : Fetch Sources
4041 name : Test Library
4142 needs : gradleValidation
4243 runs-on : ubuntu-latest
44+ timeout-minutes : 30
4345 steps :
4446
4547 # Check out current repository
Original file line number Diff line number Diff line change @@ -31,14 +31,39 @@ import com.nhaarman.mockitokotlin2.doAnswer
3131import com.nhaarman.mockitokotlin2.doReturn
3232import com.nhaarman.mockitokotlin2.mock
3333import com.nhaarman.mockitokotlin2.whenever
34+ import com.shopify.testify.internal.processor._executorDispatcher
3435import com.shopify.testify.internal.processor.compare.FuzzyCompare
36+ import kotlinx.coroutines.Dispatchers
37+ import kotlinx.coroutines.ExperimentalCoroutinesApi
38+ import kotlinx.coroutines.ObsoleteCoroutinesApi
39+ import kotlinx.coroutines.newSingleThreadContext
40+ import kotlinx.coroutines.test.resetMain
41+ import kotlinx.coroutines.test.setMain
42+ import org.junit.After
3543import org.junit.Assert.assertFalse
3644import org.junit.Assert.assertTrue
45+ import org.junit.Before
3746import org.junit.Test
3847import java.nio.IntBuffer
3948
49+ @ObsoleteCoroutinesApi
50+ @ExperimentalCoroutinesApi
4051class RegionCompareTest {
4152
53+ private val mainThreadSurrogate = newSingleThreadContext(" UI thread" )
54+
55+ @Before
56+ fun setUp () {
57+ Dispatchers .setMain(mainThreadSurrogate)
58+ _executorDispatcher = Dispatchers .Main
59+ }
60+
61+ @After
62+ fun tearDown () {
63+ Dispatchers .resetMain()
64+ mainThreadSurrogate.close()
65+ }
66+
4267 private val rectSet = HashSet <Rect >()
4368 private val regionCompare = FuzzyCompare (null , rectSet)
4469
You can’t perform that action at this time.
0 commit comments