-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmigrate.spec.lua
More file actions
28 lines (24 loc) · 865 Bytes
/
migrate.spec.lua
File metadata and controls
28 lines (24 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mtt.register("migrate v1", function(callback)
local entry = mail.get_storage_entry("old_v1_player")
assert(entry)
assert(#entry.inbox == 1)
assert(entry.inbox[1].from == "singleplayer")
assert(entry.inbox[1].to == "old_v1_player")
assert(entry.inbox[1].subject == "test1")
assert(entry.inbox[1].body == "test2")
assert(entry.inbox[1].id)
assert(entry.inbox[1].time > 0)
callback()
end)
mtt.register("migrate v2", function(callback)
local entry = mail.get_storage_entry("old_v2_player")
assert(entry)
assert(#entry.inbox == 1)
assert(entry.inbox[1].from == "someone-else")
assert(entry.inbox[1].to == "old_v2_player")
assert(entry.inbox[1].subject == "test1")
assert(entry.inbox[1].body == "test2")
assert(entry.inbox[1].id)
assert(entry.inbox[1].time == 1678467148)
callback()
end)