1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-30 10:11:34 +00:00

Add Lua test for passing a NaN value

This commit is contained in:
elsid 2025-06-05 23:58:41 +02:00
parent 093b562f58
commit 178f216317
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 8 additions and 0 deletions

View file

@ -344,6 +344,13 @@ testing.registerGlobalTest('load while teleporting - teleport', function()
landracer:teleport(player.cell, player.position)
end)
testing.registerGlobalTest('nan', function()
local nan = 0.0 / 0.0
local ok, err = pcall(function() world.setGameTimeScale(nan) end)
testing.expectEqual(ok, false)
testing.expectEqual(err, 'Value must be a finite number')
end)
return {
engineHandlers = {
onUpdate = testing.updateGlobal,

View file

@ -72,6 +72,7 @@ registerGlobalTest('memory limit')
registerGlobalTest('vfs')
registerGlobalTest('commit crime')
registerGlobalTest('record model property')
registerGlobalTest('nan', 'world.setGameTimeScale should not accept nan')
registerGlobalTest('player yaw rotation', 'rotating player with controls.yawChange should change rotation')
registerGlobalTest('player pitch rotation', 'rotating player with controls.pitchChange should change rotation')