diff options
author | Kenta Murata <mrkn@mrkn.jp> | 2020-12-17 10:05:07 +0900 |
---|---|---|
committer | Kenta Murata <mrkn@mrkn.jp> | 2020-12-18 22:00:07 +0900 |
commit | 3d3194412918012ddab185751b84ebb64fe6e5d5 (patch) | |
tree | f841830f40a363a07a4a31c1e15da8191d768ca3 /test/stringio | |
parent | 14ca7f633cae9938b7d8bc722fe1c5c96f6bcd95 (diff) |
[stringio] Make stringio Ractor safe
https://github.com/ruby/stringio/commit/ee3fec7512
https://github.com/ruby/stringio/commit/18dcd045ef
https://github.com/ruby/stringio/commit/18dcd045ef
Diffstat (limited to 'test/stringio')
-rw-r--r-- | test/stringio/test_ractor.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/stringio/test_ractor.rb b/test/stringio/test_ractor.rb new file mode 100644 index 0000000000..1c334e2c3f --- /dev/null +++ b/test/stringio/test_ractor.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +require 'test/unit' + +class TestStringIOInRactor < Test::Unit::TestCase + def setup + omit unless defined? Ractor + end + + def test_ractor + assert_in_out_err([], <<-"end;", ["true"], []) + require "stringio" + $VERBOSE = nil + r = Ractor.new do + io = StringIO.new("") + io.puts "abc" + io.truncate(0) + io.puts "def" + "\0\0\0\0def\n" == io.string + end + puts r.take + end; + end +end |