serverlistmgr_spec.lua 853 B

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