blob: 798cc494e18a9d393d2b44e75dca398ba48a6fe0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
require_relative "helper"
class TestBigDecimalRactor < Test::Unit::TestCase
include TestBigDecimalBase
def setup
super
omit unless defined? Ractor
end
def test_ractor_shareable
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
$VERBOSE = nil
require "bigdecimal"
r = Ractor.new BigDecimal(Math::PI, Float::DIG+1) do |pi|
BigDecimal('2.0')*pi
end
assert_equal(2*Math::PI, r.take)
end;
end
end
|