refactor: enhance test framework with automated resource tracking and scripted error capture capabilities

This commit is contained in:
2026-06-26 09:40:17 +08:00
parent 948a99cf90
commit 00f9d98f4b
58 changed files with 3594 additions and 1289 deletions
+13 -3
View File
@@ -29,10 +29,20 @@ func fetch_mails() -> void:
var payload = result.get("data", {})
if payload and payload is Dictionary:
mails = payload.get("mails", [])
var raw_mails = payload.get("mails", [])
if typeof(raw_mails) == TYPE_ARRAY:
mails = raw_mails
elif typeof(raw_mails) == TYPE_DICTIONARY:
mails = raw_mails.values()
else:
mails = []
var state = payload.get("state", {})
claimed_ids = state.get("claimed_ids", [])
read_ids = state.get("read_ids", [])
if typeof(state) != TYPE_DICTIONARY:
state = {}
var raw_claimed_ids = state.get("claimed_ids", [])
var raw_read_ids = state.get("read_ids", [])
claimed_ids = raw_claimed_ids if typeof(raw_claimed_ids) == TYPE_ARRAY else []
read_ids = raw_read_ids if typeof(raw_read_ids) == TYPE_ARRAY else []
# Sort by date descending
mails.sort_custom(func(a, b):