move Array#[] tests from mrbgems to test/t/array.rb

parent 5346bdd7
......@@ -107,10 +107,3 @@ assert("Array#compact!") do
a.compact!
a == [1, "2", :t, false]
end
assert("Array#[]") do
a = [ "a", "b", "c", "d", "e" ]
a[1.1] == "b" and
a[1,2] == ["b", "c"] and
a[1..-2] == ["b", "c", "d"]
end
......@@ -49,6 +49,11 @@ assert('Array#[]', '15.2.12.5.4') do
assert_equal(nil, [1,2,3].[](4))
assert_equal(3, [1,2,3].[](-1))
assert_equal(nil, [1,2,3].[](-4))
a = [ "a", "b", "c", "d", "e" ]
a[1.1] == "b" and
a[1,2] == ["b", "c"] and
a[1..-2] == ["b", "c", "d"]
end
assert('Array#[]=', '15.2.12.5.5') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment