tests: enable bundled_core and bundled_lua e2e fixtures - #119
Merged
Conversation
The e2e round-trip test skipped bundled_core and bundled_lua on the premise that they "depend on a src file the test doesn't know about." That is no longer accurate: the reverse step already unbundles each script's modules to src/ and the build step resolves the require() back in from the same fake filesystem, so no external src fixture is needed. bundled_core passes as-is once un-denied. bundled_lua nests its bundled script inside an ObjectStates entry, where the whole savegame is compared byte-for-byte. Genuine luabundle output preserves a module's trailing newline that the unbundle/re-bundle round trip normalizes away, so the byte comparison fails on formatting alone. The harness already sidesteps this for the top-level LuaScript by comparing bundled scripts as a set of module names rather than bytes. Generalize that same rule to bundled scripts at any nesting depth so a nested object script is held to the same standard as the root. Only bundled scripts are normalized; non-bundled scripts are still compared exactly, so no existing coverage is weakened. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
argonui
force-pushed
the
test/enable-bundling-fixtures
branch
from
August 4, 2026 02:34
5563ed9 to
5a48566
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes
bundled_coreandbundled_luafrom the deny list intests/e2e_test.goso the two bundling fixtures get real end-to-end round-trip coverage.Fixes #101
Why the deny list was there — and why it was wrong
The deny-list comment claimed both fixtures "depend on a src file that the test doesn't know about." That turns out to be inaccurate. Both bundles are self-contained: the module bodies are inlined in the fixture. On reverse, the harness unbundles each script's modules to
src/(viaLuaSrcWriter); on build,require()is resolved back in from the same in-memory filesystem. No external src fixture is needed.bundled_core(root-level bundled script requiringcore/Global) passes as-is once un-denied.bundled_luanests its bundled script inside anObjectStatesentry, where the savegame is compared byte-for-byte. Genuine luabundle 1.6.0 output preserves a module's trailing newline that the unbundle → re-bundle round trip normalizes away, so the comparison fails on trailing-whitespace formatting alone — not on any missing module or wrong content.The fix
The harness already sidesteps bundling's formatting-sensitivity for the top-level
LuaScriptby comparing it as a set of module names rather than bytes. This generalizes that same, already-documented rule to bundled scripts at any nesting depth, so a nested object script is held to the same standard as the root.IsBundledscripts are normalized; non-bundled object scripts are still compared exactly, so no existing fixture's coverage is weakened.bundled_luais the only fixture with a nested bundled script, so nothing else changes behavior.tests/AGENTS.mdandbundler/AGENTS.mdupdated to match.Testing
go build ./... && go vet ./... && go test ./...all green, withbundled_coreandbundled_luanow running (confirmed via-v) and passing.