We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f1432 commit d726d4fCopy full SHA for d726d4f
jvm/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie/VcrSelfie.kt
@@ -46,8 +46,10 @@ internal constructor(
46
mutableListOf<Map.Entry<String, SnapshotValue>>()
47
fun add(key: String, value: SnapshotValue) {
48
lock.withLock {
49
- frames?.add(entry(key, value))
50
- ?: throw IllegalStateException("This VCR was already closed.")
+ frames?.apply {
+ val idx = size + 1
51
+ add(entry("$OPEN$idx$CLOSE$key", value))
52
+ } ?: throw IllegalStateException("This VCR was already closed.")
53
}
54
55
fun closeAndGetSnapshot(): Snapshot =
0 commit comments