Commit f35e0d36

f35e0d36da11Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · +2 added

Description

Add regression test for strip/lstrip/rstrip removing NUL

String#strip, #lstrip, and #rstrip already remove the NUL byte along with ASCII whitespace in the current tree; lock it in with a test.

Closes #1092

Co-Authored-By: Claude Opus 4.8 [email protected]

Details

Commit
f35e0d36da11
Parent
5c3b0ec641a4

test/string_strip_nul.rbaddedView file

1+# String#strip / #lstrip / #rstrip remove the NUL byte along with ASCII
2+# whitespace, matching CRuby.
3+p "\0 abc \0".strip
4+p "abc\0\0".rstrip
5+p "\0\0abc".lstrip
6+p " \t\nx\r\f ".strip
7+p "\0".strip
8+p "no change".strip