Save Point: Profiles, Levels and Unlocks Kit
README.md
saveKitTests
Checks every public function of saveKit (88 tests), runs the README's first example as written, and checks that package.yaml, the README and Save.VERSION carry the same version. Every test saves through a fake runtime-data store (Store.use), so running the suite never writes the real player's profile; "other players" are a second fake whose writes raise the engine's own refusal.
- curves: steady (100 a level), steep (100, 140, 200, 270, 380, 540, 750, 1050, 1480, 2070), custom tables (top level = #table + 1),
levelFor/totalFor/table, aliases,describe, and the errors for bad tables. - schema:
fresh,sanitizeon garbage,upgradev1 -> v2 with a migration, a missing or failing migration (failed, record kept), a newer save, a non-table save (recovered),fillDefaults,checkMigrations,pretty,copy,num. - profile: XP and levels, stats, unlock rules by level / stat / event, buying with currency (poor / ok / owned / unknown / price),
endRunbanking, titles, cards andsanitizeCard. - catalog: the four styles and their aliases, six screens and their presentations,
matchranking,catalogue. - store: reads and writes through the stand-in, refused writes to another player's store, guests.
- save:
setup(and its errors), mode and namespace switching, events (on/off), XP and readers, autosave on level up, kills / coins / finishLevel / stats, unlocks / events / buying / currency, game fields,save/lastSaved/isDirty, checkpoint style (revert on death), roguelite style (death andnewRun), slots style (new game / load / copy / delete), rejoining, late saves and the load timeout, migrations with a.v1backup, newer, failed and unreadable saves, play-session start and end,_tick(play time, interval autosave, coalesced saves andflush), the HUD state, host hooks,grant/isMine,cardOf/players, screens, theme, panels, toasts, catalogue andmatch. - bridges: Trapline checkpoints and lives (local player only), scoreKit score -> XP with carry, pickupsKit XP orbs and coins,
available/active/start/stop, kits linked only when passed in, and saveKit on its own (no source file names another kit). - loading: XP, coins and currency earned while a save is loading count once: no save, a late save, and after switching save name or style.
- screens: every builder in every menusKit look and presentation, the HUD and panel trees at desktop and phone sizes, the format helpers, and a rendered HUD and unlock panel registered as ui screens with no validation errors.
- README: the package README's first lua example compiles.
It leaves real device input, the live save host component and on-screen rendering in play alone. Run in edit mode:
tools.use("tests", "run", { suite = "saveKitTests", onWorker = true })