Skip to content

Commit 819fa1e

Browse files
committed
Increment the index after each frame is taken.
1 parent 0000bf0 commit 819fa1e

File tree

1 file changed

+2
-1
lines changed
  • jvm/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie

1 file changed

+2
-1
lines changed

jvm/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie/VcrSelfie.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ internal constructor(
5252
val nextClose = key.indexOf(CLOSE)
5353
check(nextClose != -1)
5454
val num = key.substring(OPEN.length, nextClose).toInt()
55-
check(num == idx)
55+
check(num == idx) { "expected $idx in $key" }
5656
++idx
5757
val keyAfterNum = key.substring(nextClose + 1)
5858
state.frames.add(keyAfterNum to value)
@@ -70,6 +70,7 @@ internal constructor(
7070
var idx = 1
7171
for ((key, value) in state.frames) {
7272
snapshot = snapshot.plusFacet("$OPEN$idx$CLOSE$key", value)
73+
++idx
7374
}
7475
disk.writeDisk(snapshot, sub, call)
7576
}

0 commit comments

Comments
 (0)