summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-18 14:34:26 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-03-13 23:27:19 +0900
commit3e7e1b965b06f3c843972d7e2f6e3d040374d67f (patch)
tree340ac3e1dac18164c97209024b6768f9a045852c /test/ruby
parent2339be74e737b4c5f5330f845af2e7db0c7450e1 (diff)
Pass keyword arguments to IOs properly [Bug #16639]
(cherry picked from commit 041c2932e336b509b0ddc1fdbd9f160bce8d4893)
Diffstat (limited to 'test/ruby')
-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 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|
{#