mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user