persistence.spec.lua 636 B

123456789101112131415
  1. mtt.register("migration", function(callback)
  2. local travelnets = travelnet.get_travelnets("singleplayer")
  3. assert(type(travelnets) == "table")
  4. assert(type(travelnets["net1"]) == "table")
  5. assert(type(travelnets["net1"]["station1"]) == "table")
  6. assert(type(travelnets["net1"]["station1"].pos) == "table")
  7. assert(travelnets["net1"]["station1"].timestamp == 1663767532)
  8. assert(travelnets["net1"]["station1"].pos.x == 1022)
  9. assert(travelnets["net1"]["station1"].pos.y == 100)
  10. assert(travelnets["net1"]["station1"].pos.z == -856)
  11. travelnet.set_travelnets("singleplayer", travelnets)
  12. callback()
  13. end)