mudlet/test/functional_tests
Vadim Peretokin f8eb6b5597
fix: saved variables holding functions come back empty again instead of half-filled (#9860)
#### Brief overview of PR changes/additions

- A saved variable with a function, userdata or coroutine anywhere
inside it now exports only the members registered in `savedVars`, which
for a table ticked while empty is an empty group. Tables holding nothing
but data keep the full save added in #9762.
- The save-time walk records which saved globals hold such a value;
`XMLexport` turns the ride-along off for those variables only. Silent,
and it costs nothing outside a save.
- New `SavedVariableFenceTest` pins all 11 measured shapes, on disk and
after a reload.

#### Motivation for adding to Mudlet

A half-restored table defeats the `if next(t) == nil then rebuild() end`
guard packages carry, which kills cron-daemon's scheduler permanently on
its first minute wake after a restart.

#### Other info (issues closed, discussion etc)

Fixes #9857

**Test case:** install cron-daemon, tick `cron` in the Variables view,
add a job with a `command` function, restart and wait for the minute
rollover - the daemon keeps running (measured 2/2 canary fires, against
0/2 before).

Assisted-by: Claude:claude-opus-5
Signed-off-by: Vadim Peretokin <vadim.peretokin@mudlet.org>
2026-08-13 15:49:17 +02:00
..
ActionSelfRemovalTest.cpp infrastructure: rename the six tests Windows refuses to launch without elevation (#9753) 2026-08-11 08:07:10 +02:00
ClearWindowLogTest.cpp fix: clearing the screen no longer loses the last line from the log (#9486) 2026-07-30 08:34:29 +02:00
CMakeLists.txt fix: saved variables holding functions come back empty again instead of half-filled (#9860) 2026-08-13 15:49:17 +02:00
ColorTriggerFilterChildTest.cpp fix: color triggers now work inside 'only pass matches' trigger groups (#9442) 2026-07-27 20:20:48 +02:00
ConfigDirOverrideTest.cpp Fix an empty XDG config directory hiding every profile (#9712) 2026-08-10 22:17:09 +02:00
ConnectionDialogCrashTest.cpp infrastructure: fix two tests still opting in with an empty XDG config dir (#9810) 2026-08-11 01:50:14 +02:00
CopyAsImageTest.cpp improve: "Copy as image" now works without selecting text first (#9738) 2026-08-11 19:13:35 +02:00
cTelnetBufferTest.cpp fix: game text no longer breaks into one character per line with GA forced off (#9858) 2026-08-13 15:49:00 +02:00
DefaultGameDeleteTest.cpp Fix an empty XDG config directory hiding every profile (#9712) 2026-08-10 22:17:09 +02:00
DefaultPackagesTest.cpp fix: brand-new installs get the new-player experience again (#9745) 2026-08-12 11:14:58 +02:00
DialogTeardownTest.cpp infrastructure: leak checking now gates the functional tests (#9694) 2026-08-07 06:12:54 +02:00
DiscordIpcServerStub.cpp Infrastructure: add Discord IPC server stub for end-to-end tests (#9475) 2026-07-27 20:40:16 +02:00
DiscordIpcServerStub.h Infrastructure: add Discord IPC server stub for end-to-end tests (#9475) 2026-07-27 20:40:16 +02:00
dlgTriggerEditorUndoRedoTest.cpp fix: flag invalid aliases and block loops while typing them (#9499) 2026-07-27 20:10:18 +02:00
EdbeeReinitTest.cpp infrastructure: leak checking now gates the functional tests (#9694) 2026-08-07 06:12:54 +02:00
EditorBannerViewSwitchTest.cpp fix: help banners no longer show up in the wrong editor section (#9609) 2026-08-03 13:39:35 +02:00
EmbeddedMapperCreationTest.cpp fix: mapper scripts stopped being told the map had opened (#9709) 2026-08-07 06:20:08 +02:00
EnableDisableByNameTest.cpp infrastructure: use std::chrono literals for time durations (#9493) 2026-07-25 20:24:31 +02:00
ExperiencedPlayerGateTest.cpp fix: brand-new installs get the new-player experience again (#9745) 2026-08-12 11:14:58 +02:00
GlyphOverflowTest.cpp Fix: underscores and descenders no longer clipped at certain font sizes (#9743) 2026-08-10 22:17:29 +02:00
GMCPCharLoginTest.cpp fix: four security holes in the new browser sign-in (#9713) 2026-08-07 06:23:06 +02:00
HostChildTeardownTest.cpp fix: notepad, IRC client and toolbars outliving their profile (#9706) 2026-08-11 19:13:19 +02:00
HostWidgetDecouplingTest.cpp fix: package lifecycle - queued save outliving the profile, unremovable archives, module priority (#9684) 2026-08-05 19:55:59 +02:00
InsertTextCapTest.cpp fix: cap the length of inserted text like echoed text (#9497) 2026-07-30 15:52:22 +02:00
LogRestartDuplicateLineTest.cpp fix: log no longer duplicates a line when logging is restarted (#9490) 2026-07-27 20:41:32 +02:00
MainConsoleSelectionTest.cpp infrastructure: use std::chrono literals for time durations (#9493) 2026-07-25 20:24:31 +02:00
MapCloseDuringImportTest.cpp fix: profile close during a map operation, Discord presence truncation, and interrupting ttsSpeak() (#9686) 2026-08-07 06:10:42 +02:00
MapProgressDialogSeamTest.cpp infrastructure: decouple the mapper engine from UI dialogs (#9513) 2026-08-02 15:33:07 +02:00
MapRoundTripTest.cpp Fix: stop map saves polluting userData with fallback keys (#9469) 2026-08-05 06:41:14 +02:00
ModuleSaveTeardownTest.cpp fix: module save reaching into the profile after it is destroyed (#9690) 2026-08-06 06:08:40 +02:00
MxpFramePlacementTest.cpp fix: MXP frames overlapping UI packages that reserve screen space (#9737) 2026-08-09 10:32:06 +02:00
NarrowWindowWrapTest.cpp fix: Mudlet freezing when a window is set to wrap too narrowly (#9623) 2026-08-05 06:50:01 +02:00
NewReleaseDialogTeardownTest.cpp infrastructure: rename the six tests Windows refuses to launch without elevation (#9753) 2026-08-11 08:07:10 +02:00
PackageRemovalSaveTeardownTest.cpp infrastructure: rename the six tests Windows refuses to launch without elevation (#9753) 2026-08-11 08:07:10 +02:00
PackageSelfRemovalTest.cpp infrastructure: rename the six tests Windows refuses to launch without elevation (#9753) 2026-08-11 08:07:10 +02:00
PipelineBenchmark.cpp improve: the ISO 8859-1 decoder no longer allocates a string for every character (#9856) 2026-08-13 15:48:41 +02:00
ProfileDeletionSafetyTest.cpp infrastructure: fix two tests still opting in with an empty XDG config dir (#9810) 2026-08-11 01:50:14 +02:00
ProfileFolderNameTest.cpp Fix an empty XDG config directory hiding every profile (#9712) 2026-08-10 22:17:09 +02:00
ProfileLifecycleTest.cpp infrastructure: fix a test running against the real config dir, and guard the recipe (#9811) 2026-08-11 10:56:38 +02:00
ProfileLoadTempFileTest.cpp fix: stop crashes while saving and profiles losing their triggers (#9557) 2026-07-30 10:49:10 +02:00
ProfileRoundTripTest.cpp Infrastructure: add profile and map save/load round-trip tests (#9468) 2026-07-25 17:41:15 +02:00
ProfileSaveShutdownRaceTest.cpp fix: a queued quit no longer runs from inside a profile save (#9813) 2026-08-13 15:22:50 +02:00
ProfileSwitchShortcutTest.cpp infrastructure: trim the comments left behind by two merged QA fixes (#9708) 2026-08-06 15:43:35 +00:00
ResetProfileTest.cpp add: starter interface with health bars, map and chat for new players (#9454) 2026-07-26 08:43:21 +02:00
SavedVariableFenceTest.cpp fix: saved variables holding functions come back empty again instead of half-filled (#9860) 2026-08-13 15:49:17 +02:00
ScriptEventHandlerLifetimeTest.cpp fix: Mudlet no longer crashes when adding an event handler after switching scripts (#9839) 2026-08-13 13:37:57 +02:00
SetScriptCallbackTest.cpp fix: replacing a temp item's script no longer keeps running the old function callback (#9496) 2026-07-30 08:35:03 +02:00
SgrUnderlineStyleTest.cpp fix: colon-form underline styles now match other terminals (#9498) 2026-07-29 09:50:56 +02:00
StarterUiTriggerCostTest.cpp improve: base UI captures your gossips in its chat window (#9838) 2026-08-13 08:06:37 +02:00
SubCommandLineLifetimeTest.cpp Fix six command line and console bugs (#9683) 2026-08-05 19:55:44 +02:00
TDiscordModeTest.cpp Infrastructure: add Discord IPC server stub for end-to-end tests (#9475) 2026-07-27 20:40:16 +02:00
TelnetBenchmark.cpp infrastructure: use std::chrono literals for time durations (#9493) 2026-07-25 20:24:31 +02:00
TelnetServerStub.cpp infrastructure: stop the telnet test stub losing data sent before a client connects (#9862) 2026-08-13 13:20:12 +02:00
TelnetServerStub.h infrastructure: stop the telnet test stub losing data sent before a client connects (#9862) 2026-08-13 13:20:12 +02:00
TelnetSgrDefaultColorTest.cpp infrastructure: drop comments that restate the code beside them (#9681) 2026-08-11 08:06:16 +02:00
TelnetStringSequenceRecoveryTest.cpp fix: a stray escape code no longer silences your game for the rest of the session (#9765) 2026-08-12 11:18:14 +02:00
TelnetSubnegotiationTest.cpp fix: stop the telnet reader writing a NUL past the data it was given (#9677) 2026-08-05 14:06:45 +02:00
TelnetTextDisplayedTest.cpp fix: non-English game text no longer garbles after a stray "&" (#9489) 2026-07-27 19:48:40 +02:00
TelnetTlsPromptTest.cpp fix: stop the telnet reader writing a NUL past the data it was given (#9677) 2026-08-05 14:06:45 +02:00
TFeedTriggersRecursionTest.cpp infrastructure: drop comments that restate the code beside them (#9681) 2026-08-11 08:06:16 +02:00
TMediaLoopTest.cpp infrastructure: a media player no longer announces its own destruction (#9746) 2026-08-10 22:17:53 +02:00
TOscTest.cpp fix: script output no longer breaks the game's colour and control codes (#9485) 2026-07-27 19:17:18 +02:00
TriggerEditorTest.cpp infrastructure: use std::chrono literals for time durations (#9493) 2026-07-25 20:24:31 +02:00
TriggerSameLineMatchTest.cpp Fix triggers being deleted when a script creates a lot of them at once (#9724) 2026-08-08 08:26:28 +02:00
TtsInterruptingSpeakTest.cpp fix: profile close during a map operation, Discord presence truncation, and interrupting ttsSpeak() (#9686) 2026-08-07 06:10:42 +02:00
TUserWindowTest.cpp infrastructure: use std::chrono literals for time durations (#9493) 2026-07-25 20:24:31 +02:00
UndoServerWrapReplay.cpp add option to undo the game's own line wrapping (#9455) 2026-07-20 22:45:10 +02:00
UndoServerWrapTest.cpp fix: undoing the game's line wrapping no longer merges list entries (#9836) 2026-08-13 11:39:13 +02:00
UnitDeferredDeleteTest.cpp infrastructure: trim the comments left behind by two merged QA fixes (#9708) 2026-08-06 15:43:35 +00:00
UnitProcessingDepthTest.cpp infrastructure: take re-entrancy depth counts off with scope guards (#9687) 2026-08-06 06:05:42 +02:00
WindowBackgroundTest.cpp fix: three full-window background bugs - vanishing console, lost border colour, huge cover scaling (#9711) 2026-08-07 10:15:11 +02:00
WindowStateGettersTest.cpp fix: getWindowGeometry() and windowVisible() answer for the main window (#9714) 2026-08-07 10:15:30 +02:00
XMLexportVariablesTest.cpp fix: saved variables holding functions come back empty again instead of half-filled (#9860) 2026-08-13 15:49:17 +02:00