1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-14 21:43:06 +00:00

Add integration tests

This commit is contained in:
Evil Eye 2025-08-14 14:19:20 +02:00
parent 450f907166
commit 8073c59898
3 changed files with 15 additions and 0 deletions

View file

@ -137,6 +137,7 @@ testing.registerGlobalTest('record stores', function()
testRecordStore(core.sound, "sound") testRecordStore(core.sound, "sound")
testRecordStore(core.factions, "factions") testRecordStore(core.factions, "factions")
testRecordStore(core.regions, "regions")
testRecordStore(core.dialogue.greeting, "dialogue greeting") testRecordStore(core.dialogue.greeting, "dialogue greeting")
testRecordStore(core.dialogue.topic, "dialogue topic") testRecordStore(core.dialogue.topic, "dialogue topic")
testRecordStore(core.dialogue.journal, "dialogue journal") testRecordStore(core.dialogue.journal, "dialogue journal")

View file

@ -11,6 +11,7 @@ end
require('global_issues') require('global_issues')
require('global_dialogues') require('global_dialogues')
require('global_mwscript') require('global_mwscript')
require('global_regions')
return { return {
engineHandlers = { engineHandlers = {

View file

@ -0,0 +1,13 @@
local testing = require('testing_util')
local core = require('openmw.core')
local util = require('openmw.util')
testing.registerGlobalTest('[regions] Should expose Bitter Coast', function()
local record = core.regions.records['bitter coast region']
testing.expect(record ~= nil, 'Bitter Coast Region to exist')
testing.expectEqual(record.mapColor, util.color.hex('2227FF'))
for id, probability in pairs(record.weatherProbabilities) do
testing.expect(core.weather.records[id] ~= nil, 'weather ' .. id .. 'to exist')
end
testing.expectEqual(record.weatherProbabilities.cloudy, 60, 'cloudy weather to occur 60% of the time')
end)