mruby-io: normalize line endings in backtick command test

use chomp to strip line endings from backtick command output, making the
test platform-agnostic. remove unused $crlf variable since line ending
checks are now handled by chomp.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-17 00:07:46 +09:00
parent f8ffc05648
commit 5efd0eeed2
+3 -2
View File
@@ -2,7 +2,7 @@
# IO Test
MRubyIOTestUtil.io_test_setup
$cr, $crlf, $cmd = MRubyIOTestUtil.win? ? [1, "\r\n", "cmd /c "] : [0, "\n", ""]
$cr, $cmd = MRubyIOTestUtil.win? ? [1, "cmd /c "] : [0, ""]
def assert_io_open(meth)
assert "assert_io_open" do
@@ -658,7 +658,8 @@ end
assert('`cmd`') do
begin
assert_equal `#{$cmd}echo foo`, "foo#{$crlf}"
result = `#{$cmd}echo foo`
assert_equal "foo", result.chomp
rescue NotImplementedError => e
skip e.message
end