当我导入 org.hamcrest.Matchers
并需要使用 lessThan()
时,我无法运行单元测试。在使用 greaterThan
匹配器时,我的仪表板测试可以正常编译,但单元测试却不行。
代码:
import org.hamcrest.CoreMatchers.*
import org.hamcrest.Matchers.lessThan
import org.junit.Assert.assertThat
import org.junit.Test
import java.util.*
Gradle日志:https://pastebin.com/ibgzzrg1
删除第二行可以使项目编译并运行测试。
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
但错误仍然存在。 - HendraWD