Skip to content

Commit

Permalink
dataconnect: modernize tests in ProtoStructDecoderUnitTest.kt, ProtoS…
Browse files Browse the repository at this point in the history
…tructEncoderUnitTest.kt, and TimestampSerializerUnitTest.kt (#6335)
  • Loading branch information
dconeybe authored Oct 2, 2024
1 parent 8def61f commit 2d3e414
Show file tree
Hide file tree
Showing 7 changed files with 691 additions and 758 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ internal object ProtoUtil {

fun Value.toAny(): Any? = valueToAnyMutualRecursion.anyValueFromValue(this)

fun List<Any?>.toValueProto(): Value {
fun <T> List<T>.toValueProto(): Value {
val key = "y8czq9rh75"
return mapOf(key to this).toStructProto().getFieldsOrThrow(key)
}

fun <T> List<T>.toListValueProto(): ListValue = toValueProto().listValue

fun Map<String, Any?>.toValueProto(): Value =
Value.newBuilder().setStructValue(toStructProto()).build()

Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 2d3e414

Please sign in to comment.