testFramework: provide String overload for Registry.withValue

(cherry picked from commit 11d21d3c52bfa544f58b0f4f191eb0b2a282b424)

GitOrigin-RevId: e41853fc1ec1cedd981bb8d4c139635bc1de6e39
This commit is contained in:
Evgenii Novozhilov
2025-01-28 18:05:23 +02:00
committed by intellij-monorepo-bot
parent 84d4c0c25e
commit 1a76eabbc0

View File

@@ -11,4 +11,15 @@ inline fun RegistryValue.withValue(tempValue: Boolean, crossinline block: () ->
finally {
setValue(currentValue)
}
}
}
inline fun RegistryValue.withValue(tempValue: String, crossinline block: () -> Unit) {
val currentValue = asBoolean()
try {
setValue(tempValue)
block()
}
finally {
setValue(currentValue)
}
}