mudlet/.github
Vadim Peretokin 3c64303e65
Infrastructure: busted specs for the last uncovered UI functions (#9775)
#### Brief overview of PR changes/additions

- 134 new busted specs in `UI_spec.lua` for 24 UI functions that had no
coverage anywhere: label movies, console buffer sizing, main window
size, saved window layout, the application/profile style sheets, toolbar
buttons, command line actions, `setPopup` and `createLabel` into a user
window.
- Effects are read back for real, not just return values: movies through
`getProfileStats().gifs`, buffer limits through observed line trimming,
`setAppStyleSheet` through the `sysAppStyleSheetChange` it raises,
toolbars through `isActive()`, and the user window label by hiding its
parent. No binary fixture is committed - the movie specs assemble a
three-frame GIF89a at run time.
- The button specs install a tiny action package for the block, because
Lua cannot make a push-down button and cannot remove a `tempButton`
again; everything created is taken away in teardown, including the two
layout files that live outside the profile.

#### Motivation for adding to Mudlet

Last of the busted-reachable UI rows in the Lua API test-coverage
program. Nine functions turned out to have no reachable readback at all
and are marked `pending()` with the reason rather than given a spec that
cannot fail.

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

Bugs found while writing these, all left unspecced and marked
`pending()` instead:
- `Host::setMovie` hands the `QMovie` to the gif tracker before reading
the file, so a refused `setMovie` still counts one in
`getProfileStats()`, and over a working movie it leaves the label
driving a dead one.
- `createLabel` puts the label in the main window and answers `true`
when the parent window name is not a window.
- `showToolBar`/`hideToolBar` only answer to a package's name, never a
packaged toolbar's own name, and move every toolbar in the package at
once; an unmatched name is a silent no-op.
- `setPopup` takes a `luaL_ref` per function command before its size
check and window lookup, so both error paths strand registry references.
- `clearCmdLineSuggestions` gates on `n == 1` where
`addCmdLineSuggestion` gates on `n > 1`, so a second argument silently
retargets the main command line.
- `setConsoleBufferSize` never floors the batch deletion size, so `0`
stops the buffer shrinking at all.

Pre-existing and untouched here: on a reused profile the suite's second
run fails `getMainWindowSize returns a positive width and height` - it
reproduces identically on development.

**Test case:** full busted suite green on a fresh profile (2534
successes, 141 pending, +2.7s in `UI_spec`), and twice on one reused
profile with the same single pre-existing failure development has; 35 of
the 134 new specs (26%) verified to fail when the underlying C++ is
locally broken, and the new `MUDLET_TEST_REQUIRE_WINDOW_RESIZE` gate
proven to fail rather than skip when a resize stops working.

Assisted-by: Claude:claude-opus-5
2026-08-11 08:08:27 +02:00
..
codeql Infrastructure: disable CodeQL poorly-documented-function query (#9079) 2026-03-22 12:07:26 +01:00
ISSUE_TEMPLATE Infrastructure: New default labels and type for Github issues (#8456) 2025-10-27 18:03:46 +01:00
scripts infrastructure: fix milestone assignment, unbreak the key sequence tests (#9679) 2026-08-06 06:07:10 +02:00
skills/open-pr Infrastructure: Add Copilot skill for opening pull requests (#9105) 2026-03-24 12:28:15 +01:00
workflows Infrastructure: busted specs for the last uncovered UI functions (#9775) 2026-08-11 08:08:27 +02:00
CODEOWNERS Infrastructure: update CODEOWNERS for the 1 team we have now (#7366) 2024-07-28 19:49:00 +02:00
codespell-wordlist.txt Infrastructure: Add 'nd' as an allowed word (#5616) 2021-11-09 11:07:07 +01:00
copilot-instructions.md Infrastructure: update info for LLM agents (#8245) 2025-09-23 07:06:06 +02:00
dependabot.yml Infrastructure: Ignore lcf submodule in Dependabot, remove vcpkg (#8654) 2025-12-19 18:28:09 +01:00
pr-labeler.yml Improve translation updates (#2712) 2019-07-04 16:58:49 +02:00
PULL_REQUEST_TEMPLATE.md Infrastructure: remove 'release post highlight' from pull request template (#5959) 2022-02-07 09:46:05 +01:00
repo-metadata.yml infrastructure: fix milestone assignment, unbreak the key sequence tests (#9679) 2026-08-06 06:07:10 +02:00