summaryrefslogtreecommitdiff
path: root/test/-ext-/string/test_modify_expand.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/string/test_modify_expand.rb')
-rw-r--r--test/-ext-/string/test_modify_expand.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/-ext-/string/test_modify_expand.rb b/test/-ext-/string/test_modify_expand.rb
index 5eb7a02..d3f5a17 100644
--- a/test/-ext-/string/test_modify_expand.rb
+++ b/test/-ext-/string/test_modify_expand.rb
@@ -13,4 +13,13 @@ class Test_StringModifyExpand < Test::Unit::TestCase
s.replace("")
CMD
end
+
+ def test_integer_overflow
+ bug12390 = '[ruby-core:75592] [Bug #12390]'
+ s = Bug::String.new
+ long_max = (1 << (8 * RbConfig::SIZEOF['long'] - 1)) - 1
+ assert_raise(ArgumentError, bug12390) {
+ s.modify_expand!(long_max)
+ }
+ end
end