aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_mathn.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_mathn.rb')
-rw-r--r--test/test_mathn.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_mathn.rb b/test/test_mathn.rb
new file mode 100644
index 0000000000..d0bf03760d
--- /dev/null
+++ b/test/test_mathn.rb
@@ -0,0 +1,10 @@
+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', '1**2'], [], [], [], '[ruby-core:25740]'
+ assert_in_out_err ['-r', 'mathn', '-e', '(1<<126)**2'], [], [], [], '[ruby-core:25740]'
+ end
+end