summaryrefslogtreecommitdiffhomepage
path: root/test/t/array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/t/array.rb')
-rw-r--r--test/t/array.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/t/array.rb b/test/t/array.rb
index 2982cab01..b3952e5a5 100644
--- a/test/t/array.rb
+++ b/test/t/array.rb
@@ -57,6 +57,7 @@ assert('Array#[]', '15.2.12.5.4') do
a = [ "a", "b", "c", "d", "e" ]
assert_equal(["b", "c"], a[1,2])
assert_equal(["b", "c", "d"], a[1..-2])
+ assert_equal(["b", "c", "d", "e"], a[1..])
skip unless Object.const_defined?(:Float)
assert_equal("b", a[1.1])
end
@@ -92,6 +93,10 @@ assert('Array#[]=', '15.2.12.5.5') do
a[2...4] = 6
assert_equal([1,2,6,5], a)
+ a = [1,2,3,4,5]
+ a[2...] = 6
+ assert_equal([1,2,6], a)
+
# passing self (#3274)
a = [1,2,3]
a[1,0] = a