From 4aded2bd95735f95873c95c140d3daf4908e3d03 Mon Sep 17 00:00:00 2001 From: Bojie Li Date: Tue, 25 Aug 2026 17:38:19 +0800 Subject: [PATCH] test(android): use the JUnit assertions the project actually has MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two test files I added imported `kotlin.test`, which is not on this project's test classpath — `junit:junit:4.13.2` is the only test dependency and every other Kotlin test imports `org.junit.Assert`. They compiled nowhere and broke the Android job on main, and therefore on every open pull request, including a documentation-only one. I wrote them without compiling because I had it recorded that Android could only be built in CI. That is wrong: `./gradlew --offline` builds and runs the full 235-test suite on this machine in seconds. Verified there before this commit. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015XKX6zEAGiZFE5wAxJgYbV --- .../app/src/test/kotlin/app/donottype/core/TokenUsageTest.kt | 4 ++-- .../src/test/kotlin/app/donottype/core/TruncationGuardTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/src/test/kotlin/app/donottype/core/TokenUsageTest.kt b/android/app/src/test/kotlin/app/donottype/core/TokenUsageTest.kt index b59ee15..6ddbacc 100644 --- a/android/app/src/test/kotlin/app/donottype/core/TokenUsageTest.kt +++ b/android/app/src/test/kotlin/app/donottype/core/TokenUsageTest.kt @@ -1,7 +1,7 @@ package app.donottype.core -import kotlin.test.assertEquals -import kotlin.test.assertNull +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull import org.junit.Test /** diff --git a/android/app/src/test/kotlin/app/donottype/core/TruncationGuardTest.kt b/android/app/src/test/kotlin/app/donottype/core/TruncationGuardTest.kt index e812d2e..a5a9a5c 100644 --- a/android/app/src/test/kotlin/app/donottype/core/TruncationGuardTest.kt +++ b/android/app/src/test/kotlin/app/donottype/core/TruncationGuardTest.kt @@ -1,7 +1,7 @@ package app.donottype.core -import kotlin.test.assertFalse -import kotlin.test.assertTrue +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue import org.junit.Test /**