mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
5385ae9af4
in rational.c to refer canonicalization state for mathn support. [ruby-core:41575] [Bug #5736] * numeric.c (num_quo): ditto. * test/test_mathn.rb: add a test for the change at r41109. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
18 lines
726 B
Ruby
18 lines
726 B
Ruby
require 'test/unit'
|
|
require_relative 'ruby/envutil'
|
|
|
|
# mathn redefines too much. It must be isolated to child processes.
|
|
class TestMathn < Test::Unit::TestCase
|
|
def test_power
|
|
assert_in_out_err ['-r', 'mathn', '-e', 'a=1**2;!a'], "", [], [], '[ruby-core:25740]'
|
|
assert_in_out_err ['-r', 'mathn', '-e', 'a=(1<<126)**2;!a'], "", [], [], '[ruby-core:25740]'
|
|
assert_in_out_err ['-r', 'mathn/complex', '-e', 'a=Complex(0,1)**4;!a'], "", [], [], '[ruby-core:44170]'
|
|
assert_in_out_err ['-r', 'mathn/complex', '-e', 'a=Complex(0,1)**5;!a'], "", [], [], '[ruby-core:44170]'
|
|
end
|
|
|
|
def test_quo
|
|
assert_in_out_err ['-r', 'mathn'], <<-EOS, %w(OK), [], '[ruby-core:41575]'
|
|
1.quo(2); puts :OK
|
|
EOS
|
|
end
|
|
end
|