Skip to content

refactor(tests): extract string_type_erased.cpp (re-target of #3147) - #3166

Merged
zackees merged 1 commit into
masterfrom
feat/3131-string-type-erased-extract
Jun 16, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/3131-string-type-erased-extract

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Re-opening of #3147. Part of #3131.

Summary by CodeRabbit

  • Tests
    • Reorganized string optimization regression tests into a dedicated test file to improve test organization and provide comprehensive coverage of string operations including safety, performance characteristics, and edge cases.

… of #3131)

Second extraction in #3131. Moves the 'Type-erased basic_string
optimization tests' section (~195 LOC).

Content: COW safety, move semantics, inline-to-heap transition, self
operations, assignment + heap promotion, self-referential append, insert
on literal/view tests.

Tests pass: bash test fl_stl_string --cpp (1/1, 0.35s test time, 31s
build).

string.cpp: 6,093 -> 5,898 LOC
string_type_erased.cpp (new): 208 LOC

Stacked on feat/3131-string-memory-bugs-extract (PR #3146).

Part of #3131. Meta tracking issue: #3127.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 96b131d into master Jun 16, 2026
4 checks passed
@zackees
zackees deleted the feat/3131-string-type-erased-extract branch June 16, 2026 04:45
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3cb7dee-6ce7-4776-abbd-990f34632e23

📥 Commits

Reviewing files that changed from the base of the PR and between d323d3c and 4b81876.

📒 Files selected for processing (2)
  • tests/fl/stl/string.cpp
  • tests/fl/stl/string_type_erased.cpp

📝 Walkthrough

Walkthrough

Extracts the "Type-erased basic_string optimization tests" section (~195 lines) from tests/fl/stl/string.cpp into a new dedicated file tests/fl/stl/string_type_erased.cpp (~208 lines). The test coverage and logic are equivalent; no production code is modified.

Changes

Type-erased basic_string test extraction

Layer / File(s) Summary
New test file setup
tests/fl/stl/string_type_erased.cpp
Creates the new file with header comments and includes for fl::string and the test harness.
COW safety, move semantics, inline-to-heap transition
tests/fl/stl/string_type_erased.cpp, tests/fl/stl/string.cpp
Moves COW detachment, move construction/assignment (inline and heap), and inline-to-heap promotion test cases from string.cpp into the new file.
Self-ops, assignment, heap promotion, self-referential append, insert/replace
tests/fl/stl/string_type_erased.cpp
Moves remaining test cases covering self copy assignment, cross-instance assignment with heap promotion, self-referential append safety, and insert/replace on literal/view strings into the new file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2961: The tests moved in this PR directly validate behavior introduced or changed by the fl::basic_string type-erased refactor in that PR.
  • FastLED/FastLED#2962: Both PRs modify tests/fl/stl/string.cpp with overlapping coverage of inline↔heap transitions, self-referential append, and literal/view insert/replace edge cases.

Poem

🐇 Hop hop, a file too big,
The tests were crammed like twigs!
I pulled them out with twitchy care,
And placed them somewhere fresh and spare.
Now string_type_erased stands tall —
One tidy burrow fits them all! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/3131-string-type-erased-extract

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant