@@ -169,11 +169,13 @@ return function()
169169 expect (caughtState .Value ).to .equal (1 )
170170 expect (caughtAction .type ).to .equal (" @@INIT" )
171171 expect (caughtErrorResult .message ).to .equal (" Caught error in reducer with init" )
172- expect (string.find (caughtErrorResult .thrownValue , innerErrorMessage )).to .be .ok ()
172+ local found = string.find (caughtErrorResult .thrownValue , innerErrorMessage )
173+ expect (found ).to .be .ok ()
173174 -- We want to verify that this is a stacktrace without caring too
174175 -- much about the format, so we look for the stack frame associated
175176 -- with this test file
176- expect (string.find (caughtErrorResult .thrownValue , script .Name )).to .be .ok ()
177+ found = string.find (caughtErrorResult .thrownValue , script .Name )
178+ expect (found ).to .be .ok ()
177179
178180 store :destruct ()
179181 end )
@@ -218,11 +220,13 @@ return function()
218220 expect (caughtState .Value ).to .equal (2 )
219221 expect (caughtAction .type ).to .equal (" ThrowError" )
220222 expect (caughtErrorResult .message ).to .equal (" Caught error in reducer" )
221- expect (string.find (caughtErrorResult .thrownValue , innerErrorMessage )).to .be .ok ()
223+ local found = string.find (caughtErrorResult .thrownValue , innerErrorMessage )
224+ expect (found ).to .be .ok ()
222225 -- We want to verify that this is a stacktrace without caring too
223226 -- much about the format, so we look for the stack frame associated
224227 -- with this test file
225- expect (string.find (caughtErrorResult .thrownValue , script .Name )).to .be .ok ()
228+ found = string.find (caughtErrorResult .thrownValue , script .Name )
229+ expect (found ).to .be .ok ()
226230
227231 store :destruct ()
228232 end )
@@ -396,14 +400,16 @@ return function()
396400 -- We want to verify that this is a stacktrace without caring too
397401 -- much about the format, so we look for the stack frame associated
398402 -- with this test file
399- expect (string.find (reportedErrorError , script .Name )).to .be .ok ()
403+ local found = string.find (reportedErrorError , script .Name )
404+ expect (found ).to .be .ok ()
400405 -- In vanilla lua, we get this message:
401406 -- "attempt to yield across metamethod/C-call boundary"
402407 -- In luau, we should end up wrapping our own NoYield message:
403408 -- "Attempted to yield inside changed event!"
404409 -- For convenience's sake, we just look for the common substring
405410 local caughtErrorSubstring = " to yield"
406- expect (string.find (reportedErrorError , caughtErrorSubstring )).to .be .ok ()
411+ found = string.find (reportedErrorError , caughtErrorSubstring )
412+ expect (found ).to .be .ok ()
407413
408414 store :destruct ()
409415 end )
@@ -479,7 +485,8 @@ return function()
479485 -- We want to verify that this is a stacktrace without caring too
480486 -- much about the format, so we look for the stack frame associated
481487 -- with this test file
482- expect (string.find (caughtErrorResult .thrownValue , script .Name )).to .be .ok ()
488+ local found = string.find (caughtErrorResult .thrownValue , script .Name )
489+ expect (found ).to .be .ok ()
483490
484491 expect (caughtActionLog [1 ]).to .equal (actions [1 ])
485492 expect (caughtActionLog [2 ]).to .equal (actions [2 ])
0 commit comments