summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index a8860e1654..2da2ae95e6 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1396,6 +1396,23 @@ End
assert_in_out_err(["-", t.path], "print while $<.gets", %w(foo bar baz), [])
end
+ def test_print_separators
+ $, = ':'
+ $\ = "\n"
+ r, w = IO.pipe
+ w.print('a')
+ w.print('a','b','c')
+ w.close
+ assert_equal("a\n", r.gets)
+ assert_equal("a:b:c\n", r.gets)
+ assert_nil r.gets
+ r.close
+
+ ensure
+ $, = nil
+ $\ = nil
+ end
+
def test_putc
pipe(proc do |w|
w.putc "A"