summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-18 14:34:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-18 14:35:46 +0900
commit041c2932e336b509b0ddc1fdbd9f160bce8d4893 (patch)
treebfa45f355d5c284f31662bef1b82663f10034b57 /test/ruby/test_argf.rb
parent38070ccdeb02022a0d9def239651c82cae9a0e79 (diff)
Pass keyword arguments to IOs properly [Bug #16639]
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index a76bdccf45c..277fa368f5b 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|
{#