Added compose integration tests

commit_hash:b8423b44ec162dc4882e3be7cf8fc61fab2acbb3
This commit is contained in:
pkurchatov
2026-03-25 14:46:47 +03:00
parent b80ce9d8f0
commit fa8c8bbbf4
28 changed files with 487 additions and 341 deletions
@@ -1,7 +1,9 @@
package com.yandex.div.internal.variables
import android.net.Uri
import com.yandex.div.core.annotations.InternalApi
import com.yandex.div.data.Variable
import com.yandex.div.evaluable.types.Url
import com.yandex.div.internal.data.PropertyDelegate
import com.yandex.div.internal.data.PropertyVariableExecutor
import com.yandex.div.internal.expressions.DivExpressionParser.readTypedExpression
@@ -71,6 +73,34 @@ fun PropertyVariable.parseGet(
return expression
}
@InternalApi
val DivVariable.name: String
get() {
return when (this) {
is DivVariable.Bool -> this.value.name
is DivVariable.Integer -> this.value.name
is DivVariable.Number -> this.value.name
is DivVariable.Str -> this.value.name
is DivVariable.Color -> this.value.name
is DivVariable.Url -> this.value.name
is DivVariable.Dict -> this.value.name
is DivVariable.Array -> this.value.name
is DivVariable.Property -> this.value.name
}
}
/**
* Converts [DivVariable] value to the value that can be used in
* [com.yandex.div.evaluable.VariableProvider].
*/
@InternalApi
fun Any?.variableValueToEvaluableValue(): Any? {
return when(this) {
is Uri -> Url(toString())
else -> this
}
}
private fun PropertyVariable.toVariable(
resolver: ExpressionResolver,
propertyVariableExecutor: PropertyVariableExecutor,