test: extract setUp in BT1226IfNotNilMutationsTest#2826
Merged
Conversation
… spawn All 6 test methods opened with an identical `a := IfNotNilMutActor spawn` line. Extracting to setUp makes the shared fixture explicit and means a single edit if the fixture ever changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6edQqFhmXN77NcRGZyN47
✅ Claude Review — PASSCode Review SummaryOverall: PR is clean — no blockers, no suggestions, no nits. Changes ReviewedThe PR refactors
Correctness Assessment
|
Addresses review suggestion: every other stdlib test class using
self.a := in setUp declares the slot with a default. Without it, a
runner fallback to a bare Module:new() instance would crash with
{badkey, a} on first self.a access instead of a clean nil. Makes the
fixture slot explicit and any fallback a diagnosable failure.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015RFHaym8aCseDmmZ417jn2
Addresses Claude review suggestion: analogous actor-spawning tests (conditional_hof_state_test, actor_threading_constructs_test, future_auto_await_test) stop their fixture actor in tearDown. Adding it here stops the spawned actor after each test instead of accumulating six live processes across the suite. just test-bunit green (2666, 0 failed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RFHaym8aCseDmmZ417jn2
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.
Summary
BT1226IfNotNilMutationsTestopened with an identicala := IfNotNilMutActor spawnline, duplicating the fixture setup in every test.setUpmethod so the shared fixture is declared once. If the fixture class ever changes, there is one place to update instead of six.awithself.athroughout. No assertion logic changed.Test plan
just test-bunitpasses: 250 files, 2666 tests, 0 failed (verified locally before and after the change).Smell
rg --count '// => _' stdlib/test/and manual inspection surfaced this file as a repeated-setup candidate: six identical spawn lines across six test methods, nosetUp, notearDownneeded.Generated by Claude Code