fix: resolve all build compilation and style check warnings (#597)
* fix: resolve all build compilation and style check warnings * fix: remove unused import in SystemViewModel
This commit is contained in:
28 files changed
+293
-192
No files matched your search
@@ -52,7 +52,7 @@ class AuthManagerTest {
|
||||
every { android.util.Log.i(any(), any()) } returns 0
|
||||
|
||||
// Mock filesDir to point to temporary directory for DataStore
|
||||
val tempDir = java.io.File(System.getProperty("java.io.tmpdir"))
|
||||
val tempDir = java.io.File(System.getProperty("java.io.tmpdir") ?: "/tmp")
|
||||
testContext = TestContext(tempDir, mockContext)
|
||||
|
||||
val tempFile = java.io.File(tempDir, "server_store.json")
|
||||
@@ -101,7 +101,7 @@ class AuthManagerTest {
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
val tempDir = java.io.File(System.getProperty("java.io.tmpdir"))
|
||||
val tempDir = java.io.File(System.getProperty("java.io.tmpdir") ?: "/tmp")
|
||||
val tempFile = java.io.File(tempDir, "server_store.json")
|
||||
if (tempFile.exists()) {
|
||||
tempFile.delete()
|
||||
|
||||
@@ -430,7 +430,14 @@ class HermesApiServiceTest {
|
||||
assertEquals(100L, body?.daily?.first()?.input_tokens)
|
||||
assertEquals(0.03, body?.totals?.total_estimated_cost)
|
||||
assertEquals(2, body?.skills?.summary?.distinct_skills_used)
|
||||
assertEquals("x", body?.skills?.top_skills?.first()?.skill)
|
||||
assertEquals(
|
||||
"x",
|
||||
body
|
||||
?.skills
|
||||
?.top_skills
|
||||
?.first()
|
||||
?.skill,
|
||||
)
|
||||
assertEquals(1, body?.tools?.size)
|
||||
assertEquals("terminal", body?.tools?.first()?.tool)
|
||||
assertEquals(21820, body?.tools?.first()?.count)
|
||||
|
||||
@@ -361,7 +361,8 @@ class ChatViewModelTest {
|
||||
)
|
||||
assertTrue(
|
||||
"picker should have preloaded providers (cached at GatewayReady)",
|
||||
viewModel.uiState.value.modelPickerProviders.isNotEmpty(),
|
||||
viewModel.uiState.value.modelPickerProviders
|
||||
.isNotEmpty(),
|
||||
)
|
||||
verify(exactly = 0) { HermesWsClient.send(WsMethods.COMMAND_DISPATCH, any(), any()) }
|
||||
}
|
||||
@@ -930,7 +931,11 @@ class ChatViewModelTest {
|
||||
),
|
||||
)
|
||||
advanceUntilIdle()
|
||||
assertEquals("clarify-789", viewModel.uiState.value.clarifyRequest?.clarifyId)
|
||||
assertEquals(
|
||||
"clarify-789",
|
||||
viewModel.uiState.value.clarifyRequest
|
||||
?.clarifyId,
|
||||
)
|
||||
|
||||
viewModel.dismissClarify()
|
||||
advanceUntilIdle()
|
||||
@@ -1593,11 +1598,14 @@ class ChatViewModelTest {
|
||||
advanceUntilIdle()
|
||||
assertTrue(
|
||||
"pendingAttachments must contain the image before send",
|
||||
viewModel.uiState.value.pendingAttachments.isNotEmpty(),
|
||||
viewModel.uiState.value.pendingAttachments
|
||||
.isNotEmpty(),
|
||||
)
|
||||
assertTrue(
|
||||
"attached png must have isImage=true",
|
||||
viewModel.uiState.value.pendingAttachments.first().isImage,
|
||||
viewModel.uiState.value.pendingAttachments
|
||||
.first()
|
||||
.isImage,
|
||||
)
|
||||
|
||||
viewModel.sendMessage("Here is an image")
|
||||
|
||||
@@ -158,7 +158,7 @@ class MarkdownTextFeatureTest {
|
||||
fun testHighlight_parses() {
|
||||
val an = parseInline("==mark==", Color.Black, "", false, Color.Blue, DEFAULT_HIGHLIGHTS)
|
||||
assertEquals("mark", an.toString())
|
||||
assertTrue(an.spanStyles.any { it.item.background != null })
|
||||
assertTrue(an.spanStyles.any { it.item.background != Color.Unspecified })
|
||||
}
|
||||
|
||||
// 10. SUPERSCRIPT / SUBSCRIPT
|
||||
|
||||
Reference in new issue
Block a user