Skip to content

demo: keep every random case in the String#trim demo - #342

Merged
trans merged 1 commit into
mainfrom
claude/trim-demo-count
Sep 27, 2026
Merged

trans merged 1 commit into
mainfrom
claude/trim-demo-count

Conversation

@trans

@trans trans commented Sep 27, 2026

Copy link
Copy Markdown
Member

The "random placement" section of demo/core/string/trim.md stored its 100 random cases in a Hash keyed by the generated input. When two inputs came out the same, the later one replaced the earlier, so rake qed sometimes reported 729 assertions instead of 730.

Storing the cases as an array of [input, expected] pairs keeps all 100. The demo now reports 111/111 assertions on every run (checked three runs).

🤖 Generated with Claude Code

https://claude.ai/code/session_01E2Njj4j1r9twkVcXsMySLW


Generated by Claude Code

The demo stored its 100 random cases in a Hash keyed by the input, so a
repeated random input silently replaced an earlier case and the QED
assertion count varied between runs. An array of pairs keeps them all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2Njj4j1r9twkVcXsMySLW
@trans
trans merged commit b39714f into main Sep 27, 2026
14 checks passed
@trans trans mentioned this pull request Sep 27, 2026
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.

2 participants