From 041c2932e336b509b0ddc1fdbd9f160bce8d4893 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 18 Feb 2020 14:34:26 +0900 Subject: Pass keyword arguments to IOs properly [Bug #16639] --- test/ruby/test_argf.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_argf.rb') diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index a76bdccf45..277fa368f5 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -725,6 +725,13 @@ class TestArgf < Test::Unit::TestCase ["\"a\\n\\n\"", "\"b\\n\""], []) end + def test_each_line_chomp + assert_in_out_err(['-e', 'ARGF.each_line(chomp: false) {|para| p para}'], "a\nb\n", + ["\"a\\n\"", "\"b\\n\""], []) + assert_in_out_err(['-e', 'ARGF.each_line(chomp: true) {|para| p para}'], "a\nb\n", + ["\"a\"", "\"b\""], []) + end + def test_each_byte ruby('-e', "#{<<~"{#"}\n#{<<~'};'}", @t1.path, @t2.path, @t3.path) do |f| {# -- cgit v1.2.3