2009-11-26 07:18:22 -05:00
|
|
|
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
|
2010-06-23 01:32:46 -04:00
|
|
|
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]'
|
2012-04-08 19:05:08 -04:00
|
|
|
assert_in_out_err ['-r', 'mathn/complex', '-e', 'a=Complex(0,1)**4;!a'], "", [], [], '[ruby-core:44170]'
|
2012-04-08 13:53:51 -04:00
|
|
|
assert_in_out_err ['-r', 'mathn/complex', '-e', 'a=Complex(0,1)**5;!a'], "", [], [], '[ruby-core:44170]'
|
2009-11-26 07:18:22 -05:00
|
|
|
end
|
2013-06-06 22:50:32 -04:00
|
|
|
|
|
|
|
def test_quo
|
|
|
|
assert_in_out_err ['-r', 'mathn'], <<-EOS, %w(OK), [], '[ruby-core:41575]'
|
|
|
|
1.quo(2); puts :OK
|
|
|
|
EOS
|
|
|
|
end
|
2009-11-26 07:18:22 -05:00
|
|
|
end
|