Changes

Line 6: Line 6:  
local ShipCapabilities = require('Module:ShipCapabilities')
 
local ShipCapabilities = require('Module:ShipCapabilities')
 
local StatIcons = require('Module:Data/Asset')
 
local StatIcons = require('Module:Data/Asset')
 +
local Iterator = require('Module:Iterator')
    
local format = require('Module:Core').format
 
local format = require('Module:Core').format
Line 222: Line 223:  
return EnemyShipListKai:Table(args)
 
return EnemyShipListKai:Table(args)
 
end
 
end
 +
 +
-- * Tests.
 +
function EnemyShipListKai.test()
 +
    function testList(name, args)
 +
    local names = {}
 +
        local iterator = Iterator[name](args)
 +
        local i = 0
 +
        while iterator.next() do
 +
            names[i] = iterator.current() or '?'
 +
            i = i + 1
 +
        end
 +
        return names
 +
    end
 +
   
 +
    local result = testList('enemiesByTypeAndInstallationAndBoss', { type = '2', boss = 'no' , listBase = 'true'})
 +
mw.log(EnemyShipListKai:Table(result))
 +
 +
    result = testList('enemiesByTypeAndInstallationAndBoss', { type = '-13', boss = 'yes' , installation = 'no'})
 +
mw.log(EnemyShipListKai:Table(result))
 +
end
 +
-- p.test()
    
return EnemyShipListKai
 
return EnemyShipListKai
1,032

edits