From 3807e4f6252cb1c4efe78085dbed413a325fa85a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 24 Jun 2024 23:23:15 -0300 Subject: [PATCH] toLeopard: test repeat nesting behavior more explicitly --- .../__snapshots__/dynamic-repeat.test.ts.snap | 9 ++++----- src/__tests__/dynamic-repeat.sb3 | Bin 7511 -> 7353 bytes 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/__tests__/__snapshots__/dynamic-repeat.test.ts.snap b/src/__tests__/__snapshots__/dynamic-repeat.test.ts.snap index 25cc664..1048760 100644 --- a/src/__tests__/__snapshots__/dynamic-repeat.test.ts.snap +++ b/src/__tests__/__snapshots__/dynamic-repeat.test.ts.snap @@ -61,11 +61,10 @@ export default class Tests extends Sprite { *whenGreenFlagClicked() { this.x = 0; for (let i = 0; i < 2; i++) { - this.x += 1; - yield; - } - for (let i2 = 0, times = 2 + 2 * 0.5; i2 < times; i2++) { - this.x += 1; + for (let i2 = 0, times = 2 + 2; i2 < times; i2++) { + this.x += 1; + yield; + } yield; } for (let i3 = 0, times2 = this.x + 4; i3 < times2; i3++) { diff --git a/src/__tests__/dynamic-repeat.sb3 b/src/__tests__/dynamic-repeat.sb3 index c9844ac6c14b28b2f59ef3b33827be5d7f3c412b..117cb500a9e2ec75941f1ebe02194a1c12cf7274 100644 GIT binary patch delta 3642 zcmV-A4#n};I=ML*P)h>@3IG5A2msI$*;v^50o0KV008yf_mK{FG<}wOV`oX3-v)B5>lk%M zl^_yu{qHbqvIsv=Jvf;vDDp|L5dDgt~HGo=Bl z7FB2{|3Qs-Lm2ANAq)*u9XNPd75WZIv1oqYVxSV6Vd_YKqr9#HQ2@4D@oy}#dPW!r zP+8ZY&UEzaLN&}Gwh@g5tY_PhE6edf=!?3lF<2*(IRIJ#8mc@r5ko4Af@U9 zfOJe5qYjcohJa>TM8BCJ42GbK~ zK{kZpy`whJd^d2Fu_c zWiW-h?XsAs2?v@=MMLOuB#BTh=|C|wfb1wtsVKL9E=J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