From 92dca4fa1c5c51f5e842b44184f4b0c4dd29858c Mon Sep 17 00:00:00 2001 From: aaron <83140718+centau@users.noreply.github.com> Date: Tue, 29 Aug 2023 23:15:37 +0100 Subject: [PATCH] Fix tests failing on O2 --- test/tests.luau | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/tests.luau b/test/tests.luau index d66cf42..da7a3ec 100644 --- a/test/tests.luau +++ b/test/tests.luau @@ -1039,11 +1039,13 @@ TEST("indexes()", function() local count = table.create(3, 0) local unrelated_count = 0 - local function unrelated() - cleanup(function() - unrelated_count += 1 - end) - end + local unrelated = (function() + return function() + cleanup(function() + unrelated_count += 1 + end) + end + end)() local output = indexes(input, function(v, i) -- check that overriden cleanup scopes don't affect cleanup calls @@ -1165,11 +1167,13 @@ TEST("values()", function() local count = table.create(3, 0) local unrelated_count = 0 - local function unrelated() - cleanup(function() - unrelated_count += 1 - end) - end + local unrelated = (function() + return function() + cleanup(function() + unrelated_count += 1 + end) + end + end)() local output = values(input, function(v, i) -- check that overriden cleanup scopes don't affect cleanup calls