Skip to content

tests: enable bundled_core and bundled_lua e2e fixtures - #119

Merged
argonui merged 1 commit into
mainfrom
test/enable-bundling-fixtures
Aug 4, 2026
Merged

tests: enable bundled_core and bundled_lua e2e fixtures#119
argonui merged 1 commit into
mainfrom
test/enable-bundling-fixtures

Conversation

@argonui

@argonui argonui commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What

Removes bundled_core and bundled_lua from the deny list in tests/e2e_test.go so 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/ (via LuaSrcWriter); 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 requiring core/Global) passes as-is once un-denied.
  • bundled_lua nests its bundled script inside an ObjectStates entry, 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 LuaScript by 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.

  • Only IsBundled scripts are normalized; non-bundled object scripts are still compared exactly, so no existing fixture's coverage is weakened. bundled_lua is the only fixture with a nested bundled script, so nothing else changes behavior.
  • Docs in tests/AGENTS.md and bundler/AGENTS.md updated to match.

Testing

go build ./... && go vet ./... && go test ./... all green, with bundled_core and bundled_lua now running (confirmed via -v) and passing.

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
argonui force-pushed the test/enable-bundling-fixtures branch from 5563ed9 to 5a48566 Compare August 4, 2026 02:34
@argonui
argonui merged commit b0f6abc into main Aug 4, 2026
@argonui
argonui deleted the test/enable-bundling-fixtures branch August 4, 2026 02:34
argonui added a commit that referenced this pull request Aug 4, 2026
fix: e2e_test.go 3-value UnbundleAll (unbreak main after #118+#119)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundling end-to-end fixtures are disabled

1 participant