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:
parent
093b562f58
commit
178f216317
2 changed files with 8 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue