2021-01-22 16:08:57 +01:00
|
|
|
_G.core = {}
|
2022-03-29 18:07:00 +02:00
|
|
|
_G.vector = {metatable = {}}
|
2021-01-22 16:08:57 +01:00
|
|
|
_G.unpack = table.unpack
|
|
|
|
_G.serverlistmgr = {}
|
|
|
|
|
2021-06-04 21:22:33 +02:00
|
|
|
dofile("builtin/common/vector.lua")
|
2021-01-22 16:08:57 +01:00
|
|
|
dofile("builtin/common/misc_helpers.lua")
|
|
|
|
dofile("builtin/mainmenu/serverlistmgr.lua")
|
|
|
|
|
|
|
|
local base = "builtin/mainmenu/tests/"
|
|
|
|
|
|
|
|
describe("legacy favorites", function()
|
|
|
|
it("loads well-formed correctly", function()
|
|
|
|
local favs = serverlistmgr.read_legacy_favorites(base .. "favorites_wellformed.txt")
|
|
|
|
|
|
|
|
local expected = {
|
|
|
|
{
|
|
|
|
address = "127.0.0.1",
|
|
|
|
port = 30000,
|
|
|
|
},
|
|
|
|
|
|
|
|
{ address = "localhost", port = 30000 },
|
|
|
|
|
|
|
|
{ address = "vps.rubenwardy.com", port = 30001 },
|
|
|
|
|
|
|
|
{ address = "gundul.ddnss.de", port = 39155 },
|
|
|
|
|
|
|
|
{
|
|
|
|
address = "daconcepts.com",
|
|
|
|
port = 30000,
|
|
|
|
name = "VanessaE's Dreambuilder creative Server",
|
|
|
|
description = "VanessaE's Dreambuilder creative-mode server. Lots of mods, whitelisted buckets."
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.same(expected, favs)
|
|
|
|
end)
|
|
|
|
end)
|