mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
80244ea4e2
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.
20 lines
1.0 KiB
Lua
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")
|