diff --git a/scripts/data/integration_tests/test_lua_api/global.lua b/scripts/data/integration_tests/test_lua_api/global.lua index 225660b858..31d1b040db 100644 --- a/scripts/data/integration_tests/test_lua_api/global.lua +++ b/scripts/data/integration_tests/test_lua_api/global.lua @@ -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, diff --git a/scripts/data/integration_tests/test_lua_api/menu.lua b/scripts/data/integration_tests/test_lua_api/menu.lua index 8c6895a5d8..4f8dbd99c6 100644 --- a/scripts/data/integration_tests/test_lua_api/menu.lua +++ b/scripts/data/integration_tests/test_lua_api/menu.lua @@ -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')