File tree Expand file tree Collapse file tree
tests/gluatest/expectations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ return function( subject, ... )
178178 function expectations .succeed ()
179179 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .succeed expects a function" )
180180
181+ jit .off ( subject , false )
181182 local success = pcall ( subject , unpack ( args ) )
182183
183184 if success ~= false then
@@ -189,6 +190,7 @@ return function( subject, ... )
189190 function expectations .err ()
190191 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .err expects a function" )
191192
193+ jit .off ( subject , false )
192194 local success = pcall ( subject , unpack ( args ) )
193195
194196 if success ~= true then
@@ -202,6 +204,7 @@ return function( subject, ... )
202204 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .errWith expects a function" )
203205 assert ( isstring ( comparison ), " errWith expects a string" )
204206
207+ jit .off ( subject , false )
205208 local success , err = pcall ( subject , unpack ( args ) )
206209
207210 if success == true then
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ return function( subject, ... )
177177 function expectations .succeed ()
178178 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .succeed expects a function" )
179179
180+ jit .off ( subject , false )
180181 local success , err = pcall ( subject , unpack ( args ) )
181182
182183 if success == false then
@@ -188,6 +189,7 @@ return function( subject, ... )
188189 function expectations .err ()
189190 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .err expects a function" )
190191
192+ jit .off ( subject , false )
191193 local success = pcall ( subject , unpack ( args ) )
192194
193195 if success == true then
@@ -201,6 +203,7 @@ return function( subject, ... )
201203 assert ( TypeID ( subject ) == TYPE_FUNCTION , " .errWith expects a function" )
202204 assert ( TypeID ( comparison ) == TYPE_STRING , " .errWith expects a string" )
203205
206+ jit .off ( subject , false )
204207 local success , err = pcall ( subject , unpack ( args ) )
205208
206209 if success == true then
Original file line number Diff line number Diff line change 1+ --- @diagnostic disable : param-type-mismatch
2+ return {
3+ groupName = " callerRecovery" ,
4+ cases = {
5+ {
6+ name = " Called function name is included in error message" ,
7+ func = function ()
8+ -- This never worked, instead of 'Left' it had given '?'
9+ expect ( string .Left , nil ).to .errWith ( " bad argument #1 to 'Left' (string expected, got nil)" )
10+
11+ -- This is how it always had worked fine
12+ local testFunc = function () string .Left ( nil , nil ) end
13+ expect ( testFunc ).to .errWith ( " bad argument #1 to 'Left' (string expected, got nil)" )
14+ end
15+ }
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments