Files
bookorbit/koreader-plugin/spec/bookorbit_device_names_test.lua
neon 80244ea4e2 feat(koreader): rebuild the plugin interface and fix four-way annotation sync
Squash of feat/koreader-widget-board. KOReader plugin 2.0.0 gets the widget-board dashboard, redesigned
book details, menus, lists and dialogs, Decor page and reading companions. Highlights, notes and bookmarks
now stay in step across web, Kobo, KOReader and the phones (defects D-00 to D-20, migration 0121), and
reading progress and narration hand off cleanly between devices.
2026-10-20 16:05:27 -06:00

20 lines
1.0 KiB
Lua

-- The progress prompt names the device holding the other position the way
-- people know it, not by the model id KOReader reports.
package.path = "koreader-plugin/bookorbit.koplugin/?.lua;" .. package.path
local DeviceNames = require("bookorbit_device_names")
local function assertEqual(actual, expected, label)
if actual ~= expected then error(string.format("%s: expected %s, got %s", label, tostring(expected), tostring(actual))) end
end
assertEqual(DeviceNames.label("Kobo_monza"), "Kobo Libra Colour", "a Kobo codename becomes its retail name")
assertEqual(DeviceNames.label("Kobo_spaBW"), "Kobo Clara BW", "the newest Kobos are known")
assertEqual(DeviceNames.label("KindlePaperWhite5"), "Kindle Paperwhite 5", "Kindle model ids read as names")
assertEqual(DeviceNames.label("macOS"), "macOS", "an unknown device shows as reported")
assertEqual(DeviceNames.label(""), nil, "an empty name is no name")
assertEqual(DeviceNames.label(nil), nil, "a missing name is no name")
print("bookorbit_device_names_test.lua: ok")