Skip to content

Commit 67e413d

Browse files
author
David Motsonashvili
committed
format and fix tests
1 parent d5a1363 commit 67e413d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/Content.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ constructor(public val role: String? = "user", public val parts: List<Part>) {
8585
}
8686

8787
@OptIn(ExperimentalSerializationApi::class)
88-
internal fun toInternal() =
89-
Internal(this.role ?: "user", this.parts.map { it.toInternal() })
88+
internal fun toInternal() = Internal(this.role ?: "user", this.parts.map { it.toInternal() })
9089

9190
@ExperimentalSerializationApi
9291
@Serializable

firebase-ai/src/test/java/com/google/firebase/ai/type/FunctionDeclarationTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ package com.google.firebase.ai.type
1818

1919
import io.kotest.assertions.json.shouldEqualJson
2020
import kotlinx.serialization.encodeToString
21+
import kotlinx.serialization.json.ClassDiscriminatorMode
2122
import kotlinx.serialization.json.Json
2223
import org.junit.Test
2324

2425
internal class FunctionDeclarationTest {
26+
internal val JSON = Json { classDiscriminatorMode = ClassDiscriminatorMode.NONE }
2527

2628
@Test
2729
fun `Basic FunctionDeclaration with name, description and parameters`() {
@@ -53,7 +55,7 @@ internal class FunctionDeclarationTest {
5355
"""
5456
.trimIndent()
5557

56-
Json.encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
58+
JSON.encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
5759
}
5860

5961
@Test
@@ -95,6 +97,6 @@ internal class FunctionDeclarationTest {
9597
"""
9698
.trimIndent()
9799

98-
Json.encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
100+
JSON.encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
99101
}
100102
}

0 commit comments

Comments
 (0)