Repository navigation
Test framework: fix the old test bugs in alscript's and lscript's tests - #463
Conversation
Old test bugs #462's idiom pass found, fixed. - alpreprocessor: - "yes4 on its line" compared a find() with itself; it now checks yes4 is output line 19, where the source has it; - three messages were built before the call that fills their reason (the grid builtins' load, and the @line reader's twice): each call comes first now; - guards before reads that could fail: a source location found before its file is read, the size-weighed note's five arguments, a module note's three, and a problem said before problems.back() in the five cases that overrun a limit (CHECK(r.overran) alone did not say there was one). - alincludesearch: the problems an explanation adds, and the suggestions in ./lib/, are sized before they are indexed. - aldiskcache: "kept a moment" could not fail. It held a reference to the list the cache keeps, which the next call for the same folder refills, so it compared that list with itself; it holds a copy now. The later list is sized before [1] is read. - alscriptlexicon: a line comment's end is checked against the text's length before the character there is read; s.closed was no guard, since a line comment is always closed. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old test bugs #462's idiom pass found, fixed. - Messages built before the call that fills their reason, so they said nothing or an earlier call's error: in alluauservice, the definitions' loads, a switch of solver and back, the docs' load and a configuration's parse; in alluauconfig, the parses and the script runs. Each call now comes first, and the messages the idiom pass had cut for saying nothing are back where a failure needs them. - allslservice: "another region's builtins" built its message before the load, from a local that hid the fixture's error; the second load's result hid the fixture's loaded. Both are renamed, and the load comes first. - Guards before reads that could fail: - alluauservice: an outline's first entry, and two lints' arguments; an INFO no longer indexes a signature's parameters by an active parameter that may be past them; - allslservice: the third problem's arguments; - allsleffects: the matches and the calls each case reads two of; - allslconsts: a declaration's position, before an iterator is made from it. - Leftovers: allsleffects included linden_common.h twice, and alluauservice had a comment line its next one repeated. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing, in both solvers' runs. Three restored messages (a switch of solver, back, and the other solver's load) have none: no change to the test makes one solver refuse definitions the other took. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old test bugs #462's idiom pass found, fixed. - A label before CHECK(require_fixed(...) == ...) was taken by the helper's own first assertion: an unscoped message goes to the next assertion, which is the helper's, so a failing CHECK carried no label and the helper's carried the wrong one. Each is a scoped INFO around its CHECK now: 52 in alscriptfixes, 58 in alscriptlintpass. - alscriptfixes built four messages by calling require_acted_on, so the helper, its REQUIREs with it, ran twice; it runs once, and the message reads its result. - alscriptfixes, guards before reads that could fail: the fixes offered for a removal, a require, an include and a negation, each sized before front(). "Not offered a name declared after" read the first fix's second argument unchecked; it now checks no fix offers it. - Both fixtures wrote every load's error to one string, so a "builtins:" or "definitions:" message could show another load's error, or none: each load has its own. - alscriptlintpass: a comment about TUT's fifty-test limit goes. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing, in both solvers' runs. alscriptfixes runs 858 assertions where it ran 865: the helper no longer runs twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y they check Old test bugs #462's idiom pass found, fixed. Most were reads through what a lookup returned, with nothing checking it found anything: a miss would have crashed the binary, taking every later case with it, rather than failing its own. - Guards before the first read of each lookup: - almasterindex: linkOf(), ALMasterLinks::of() and the index read back from disk (kept in a variable, so the pointer into it stays good); - almasterwatch: the folders asked about, and each period; - almasterburst: every dueAt(); - almasterlinks: of() and find(), and the links left after a remove, which nothing sized; - almodulelook: each module named, and its names; - alscriptenvelope: the code line in its text, the lines either side, and each upload header parsed; - alnotecardformat: each notecard named; - alscriptformatter: the lines a range asked for. - almessagemap: every match shared one Match, so a match that failed showed the one before it, and args[1] was in bounds only because an earlier match had filled args. Each match has its own, and each checks its whole args, which also checks the module name is left blank, as the case says. - alscriptformatter: "a line asked for" checked a line not asked for, as written, which is what formatEach promises; the message says so. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. almodulelook's names guard has none: every module the look finds has a name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… they check Old test bugs #462's idiom pass found, fixed. - allsltoslua: - "state_entry's, kept" looked for ll.OwnerSay, which the conversion writes as print, so the order it checked was against npos and could not fail; it finds both, then checks the order; - two order checks passed when what they ordered was missing; each first checks it is there; - the "handler over both" checks ran only if some span started on LSL line 4; the span is required now. - allsloptimizer: - "Mono: what it wrote weighs what it says" weighed nothing: when Mono came to weigh a list's shapes against the helpers they bring in, its "l + a" check was loosened to "l = l" and given that message. Its weight is now checked against the weigher's, and "l = l" keeps a message of its own; - each ALLSLTraits::of() is required before it is read. - alscriptweight: - three messages were built before the call that fills their reason (a definitions load, two rewrites): each call comes first now; - "where it is declared" and "where it ends" stood one check off their checks; count's end was checked as at least line 8, and is line 10, its end; - a handler looked up by name is required before it is read. - allslreferencecheck (lscript): "Tailslide compiles it" was built before the compile filled its reason. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing, in both solvers' runs where the file has two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Its message was built from error before loadBuiltins filled it, so a failed load said nothing; the load comes first now. Found by CodeRabbit's review of #462, the same mistake the other follow-up commits fix elsewhere. A missing builtins file now fails the check with the load's reason, in both solvers' runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
Fixes the bugs in alscript's and lscript's own tests that the Catch2 conversion in #462 found and kept, since a conversion must not change what a test does. Each fixed test was one that:
It stacks on #462 (
rye/tests-tm21) and changes only test files.Preprocessor (19b270f)
find()with itself. It now checks yes4 is on output line 19, where the source has it.problems.back()in the five cases that overrun a limit.Luau and LSL services (752f807)
errorandloaded.alluaufragment (36be676): its "builtins loaded" message was built before the load that fills its reason. CodeRabbit found it in its review of #462.
Lints and fixes (6f4d178)
CHECK(require_fixed(...) == ...)went to the helper's own first assertion, not to the CHECK. Each is now a scoped INFO around its CHECK: 52 in alscriptfixes, 58 in alscriptlintpass.Disk masters, envelopes, messages (3fccb75)
linkOf(),of(), and the index read back from disk;Match, so a failed match showed the one before it. Each match now has its own, and checks all of its arguments, so it also checks that the module name is left blank, as the case's name says.Conversion, optimizer, weights (212f053)
ll.OwnerSay, which the conversion writes asprint, so it compared against "not found" and could not fail;l = lcheck it replaced keeps a message of its own.Related Issues
Issue Link: none. The bugs were found by #462's idiom pass and listed in e661a8e's message.
Checklist
Additional Notes
🤖 Generated with Claude Code