Repository navigation
Tests: fix 15 tests that would pass with the bug they name - #554
Merged
Merged
Conversation
Each fix is proven the same way: under one planted break in product code, the old test stays green and the fixed test goes red; unbroken, the fixed test passes. The breaks are listed in the PR. - diffArtifacts: the rmSync guard test now plants a sentinel where an unguarded path would resolve and requires it to survive. The throw alone passed with rmSync moved above the guard. - nauvis_stack parity: replace `assert_eq!(x, x)` with the resolver's winner and the tree block's first field. - seed: randomU32 returning a constant passed the range test. - findIslands: "marks exactly the refined rows" asserted `<= 2`. - fmw-wasm survey: the Nauvis request never reached the planet guard; it now has a well-formed Nauvis case and asserts exact statuses. - fulgora_ocean: the shallow-variant test now reads both variants. - decode: the cliff.control test checks every preset, and Death world's time_factor is pinned to the game's 0.00002 instead of `not.toBe`. Also corrects the Vulcanus seed-trap bound, which became `> 0` once the frozen count reached 0. No single break separates old from new there, so that one is a comment-and-scale correction, not a proven fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ
Proven the same way as the first batch (old green and fixed red under one planted break, unless noted): - controlRow: count the sliders before `every()`, which is true on an empty list (break: hide the sliders at size 0). - resourceIcons, terrainTab, islandFinderPanel (x2): each negative check now first asserts the element it looks inside exists (breaks: the tab, the trees row, the island rows not rendered). - advancedTab: the expression dump must sit inside a details that starts closed (break: the details opens by default). - actionBar: poll for the blob URL instead of sleeping 100 ms. Proven in the other direction: with the zip delayed 300 ms the old test failed and the new one passed. - Renamed three tests whose names claimed more than they check (chainGraph, the Fulgora scrap footprint, store's nested views). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Fixes 15 tests that would pass with the bug they name. Each fix is proven, and no test is deleted.
How each fix was proven
The audit's two-run check: plant one break in product code, run the old test as it was at
main(it stays green), then run the fixed test under the same break (it goes red on its own assertion). With the break removed, the fixed test passes. A script did each run and restored both files byte for byte.diffArtifacts.spec.ts"never calls rmSync when a traversal case name reaches writeDiffArtifacts"rmSyncmoved above it, the test stayed green while the escaped folder was deleted. It now plants a sentinel where the unguarded path resolves and requires it to survive.rmSyncon the raw joined path, beforeartifactPathsnauvis_stack.rsthe_resource_block_starts_where_the_tile_block_ends...assert_eq!(x, x), which cannot faili < 18->i < 19)seed.spec.tsrandomU32that always returns 0 passedreturn 0;findIslands.spec.ts"marks exactly the refined rows as refined"<= 2, so zero refined rows passedfmw-wasma_nauvis_request_is_not_surveyedassert_ne!(_, 0), and the request was refused for its length before the planet check ranfulgora_ocean.rsthe_shallow_variants_are_selected_by_sign...ocean_tileanswers only "shallow", so the sign was never checkeddecode.spec.tsDeath world time_factornot.toBe(Default)accepted any wrong value; now pinned to the game's0.00002(base/prototypes/map-gen-presets.lua)decode.spec.tscliff control stringcontrolRow.spec.tsalways-on control at size 0every()is true on an empty listresourceIcons.spec.tsno icons on the Terrain tabterrainTab.spec.tsno info glyph on treesislandFinderPanel.spec.tsno divider / unclipped row (2 tests)advancedTab.spec.tsdump in a collapsed detailsOne fix is proven the other way round.
actionBar.spec.tswaited a fixed 100 ms for the zip export, which can fail on a slow runner with nothing wrong. With the zip delayed 300 ms, the old test failed and the new one, which polls withvi.waitFor, passed.Also changed, not separately proven
wasmVulcanusRenderParity.spec.tsseed trap: the bound> DIFFERING_PX * 10became> 0once the frozen count reached 0, and its comment ("an order of magnitude worse") became false. At the raw map seed 940,914 of 1,048,576 pixels differ, so it now asserts more than half. No single break separates old from new here: any break that makes the seed matter less also turns the frozen-count test red.chainGraph(it never callsboxGap), the Fulgora scrap footprint (it asserts 0 pixels outside), andstore's nested views (it checks one float, not bytes).Checked and left alone
The audit flagged these, and checking showed the claim was wrong:
islandFinderPanel"in TILES, not pixels": the old test already fails when the rectangle prints in pixels.devMode.spec.ts: it pins the literal key, so a colliding key already fails it.cliffCatalog.spec.ts'stypeofloop: it catches a table shorter than 256 entries.Gate
pnpm run verify:lint, the fullpnpm vp testandscripts/verify-rust.shpass on this branch.engine.wasmis unchanged, because every Rust edit is inside a#[cfg(test)]module.The weak Rust tests that recompute a formula instead of calling the product are in a separate PR.
Found by a read-only test audit (the
pruning-testsskill).🤖 Generated with Claude Code
https://claude.ai/code/session_01Kd6o1dTdCEZ5JSjytamwMZ