serverlistmgr_spec.lua 915 B

12345678910111213141516171819202122232425262728293031323334353637
  1. _G.core = {get_once = function(_) end}
  2. _G.unpack = table.unpack
  3. _G.serverlistmgr = {}
  4. dofile("builtin/common/vector.lua")
  5. dofile("builtin/common/misc_helpers.lua")
  6. dofile("builtin/mainmenu/serverlistmgr.lua")
  7. local base = "builtin/mainmenu/tests/"
  8. describe("legacy favorites", function()
  9. it("loads well-formed correctly", function()
  10. local favs = serverlistmgr.read_legacy_favorites(base .. "favorites_wellformed.txt")
  11. local expected = {
  12. {
  13. address = "127.0.0.1",
  14. port = 30000,
  15. },
  16. { address = "localhost", port = 30000 },
  17. { address = "vps.rubenwardy.com", port = 30001 },
  18. { address = "gundul.ddnss.de", port = 39155 },
  19. {
  20. address = "daconcepts.com",
  21. port = 30000,
  22. name = "VanessaE's Dreambuilder creative Server",
  23. description = "VanessaE's Dreambuilder creative-mode server. Lots of mods, whitelisted buckets."
  24. },
  25. }
  26. assert.same(expected, favs)
  27. end)
  28. end)