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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
-- Run this with the real Panto interpreter from pantograph:
-- panto lua scripts/verify-against-core.lua
--
-- Compare the extension's computed snapshots directly with core so mismatches
-- remain visible even when activation skips names already owned by core.
local source = debug.getinfo(1, "S").source
local scripts_dir = source:match("^@(.*)/[^/]+$") or "."
local root = scripts_dir .. "/.."
package.path = root .. "/?.lua;" .. package.path
local panto = require("panto")
local roles = {
"dim", "assistant", "user", "tool", "footer", "tool_text",
"tool_pending", "tool_success", "tool_error", "compaction_header",
"thinking_header", "cursor", "err", "welcome", "waiting_peak",
"waiting_near", "waiting_far", "err_diff", "add_diff", "thinking",
"compaction", "user_bg", "tool_pending_bg", "tool_success_bg",
"tool_error_bg", "diff_remove_bg", "diff_add_bg", "user_text",
"tool_header", "canvas_fg", "canvas_bg", "syntax_base",
"syntax_comment", "syntax_string", "syntax_number", "syntax_keyword",
"syntax_function", "syntax_type", "syntax_variable", "syntax_tag",
"reset",
}
local moved = {
"Tokyo Night", "Catppuccin Mocha", "Gruvbox Dark", "Solarized Light",
"Solarized Dark", "Nord", "Dracula", "Tokyo Storm", "Tokyo Moon",
"Tokyo Day", "Catppuccin Latte", "Catppuccin Frappe",
"Catppuccin Macchiato", "Gruvbox Dark Hard", "Gruvbox Dark Soft",
"Gruvbox Light", "Gruvbox Light Hard", "Gruvbox Light Soft",
"Dracula Soft",
}
local entry = require("panto-popular-themes.init")
assert(entry.name == "themes.popular", "wrong extension entry")
assert(type(entry.values) == "function", "missing extension values")
-- Activation skips names already owned by core or another extension, so
-- compare the generated snapshots directly instead of relying on a conflict.
for _, name in ipairs(moved) do
local expected = panto.ext.style(name)
local actual = entry.values(name)
assert(actual, "extension has no theme " .. name)
for _, role in ipairs(roles) do
if expected[role] ~= actual[role] then
error("theme " .. name .. " role " .. role .. " mismatch", 0)
end
end
end
entry.activate()
|