Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
Module:EnemyShipListKai
(view source)
Revision as of 05:23, 2 January 2023
689 bytes added
,
1 year ago
→Added test function
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
Memetails
1,032
edits