From dcf2cbe6fb01a3317085a53c3d2548d624dab51d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 19:33:08 +0000 Subject: [PATCH] demo: keep every random case in the String#trim demo 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 Claude-Session: https://claude.ai/code/session_01E2Njj4j1r9twkVcXsMySLW --- demo/core/string/trim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/core/string/trim.md b/demo/core/string/trim.md index dec124875..6e091bd37 100644 --- a/demo/core/string/trim.md +++ b/demo/core/string/trim.md @@ -75,7 +75,7 @@ spacing random placement - @volly = {} + @volly = [] 100.times{ |n| k = [] a = [] @@ -83,7 +83,7 @@ random placement k << ( ( ' ' * Integer(rand*10) ) + '|' + i.to_s ) a << ( i.to_s ) } - @volly[k.join("\n")] = a.join("\n") + @volly << [k.join("\n"), a.join("\n")] } @volly.each{ |k,v|