Skip to content

test(rename): cover no-arg PascalCase derivation from the git remote#248

Merged
devantler merged 1 commit into
mainfrom
claude/test-rename-derive-from-remote
Jun 27, 2026
Merged

test(rename): cover no-arg PascalCase derivation from the git remote#248
devantler merged 1 commit into
mainfrom
claude/test-rename-derive-from-remote

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Daily AI Assistant

What

Adds a Case 4 to scripts/rename-placeholders.test.sh that exercises the script's no-argument path — deriving a PascalCase project name from origin's GitHub remote.

Why

rename-placeholders.sh is the first thing a newcomer runs after Use this template, and running it with no argument is its documented default:

With no argument it derives a PascalCase name from origin's GitHub repo name.

That branch carries real, easy-to-break logic — URL parsing plus the awk segment-split/capitalise (my-cool-appMyCoolApp) — yet every existing test case passes an explicit name (Widget, Acme.Widget, …), so the entire derivation branch was unexercised. A regression there ships a wrongly-named scaffold to anyone who runs the default.

What the new case pins

  • 4a — https remote, separator/dot collapse: https://github.com/acme/my--cool.app.gitMyCoolApp (doubled - and the . collapse to a single token); asserts the .slnx/src/ rename and the repointed namespace, and that the Example original is gone.
  • 4b — scp-style remote: git@github.com:acme/widget-svc.gitWidgetSvc (proves the git@host:owner/repo.git form derives identically).

make_copy() inits a git repo with no remote, so each sub-case adds its own origin. No build is run in the new cases (Case 2 already covers build/test); the cleanup trap is extended to the two new throwaway copies.

Validation

  • sh scripts/rename-placeholders.test.shPASS (all 4 cases; build/test still green).
  • Mutation-checked (non-vacuous): dropping toupper() from the awk derivation makes the script emit mycoolapp and Case 4a fails as expected; restored.
  • shellcheck -s sh clean. Test-only change — rename-placeholders.sh is untouched.

The go-template rename script has the same untested derive-from-remote branch (module-path parsing); a sibling PR will cover it.

@devantler devantler marked this pull request as ready for review June 27, 2026 08:10
@devantler devantler requested a review from a team as a code owner June 27, 2026 08:10
@devantler devantler merged commit 3d29f73 into main Jun 27, 2026
10 checks passed
@devantler devantler deleted the claude/test-rename-derive-from-remote branch June 27, 2026 08:15
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.

1 participant