Check negative integer underflow

This commit is contained in:
Nobuyoshi Nakada 2024-11-26 10:55:49 +09:00 committed by Nobuyoshi Nakada
parent c08e1f336c
commit 02b70256b5
Notes: git 2024-11-26 02:46:55 +00:00
2 changed files with 9 additions and 3 deletions

View file

@ -164,6 +164,11 @@ CODE
assert_raise(ArgumentError) { "foo"[] }
end
def test_AREF_underflow
require "rbconfig/sizeof"
assert_equal(nil, S("\u{3042 3044 3046}")[RbConfig::LIMITS["LONG_MIN"], 1])
end
def test_ASET # '[]='
s = S("FooBar")
s[0] = S('A')