summaryrefslogtreecommitdiffhomepage
path: root/test/t/array.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-01-30 10:33:47 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-01-30 10:33:47 +0900
commit00062780882ad54f800b19412a1412bb864109b8 (patch)
treee444b00182cc0657d6aa98c7c9e60b7575eb8b84 /test/t/array.rb
parent5346bdd76b3946a94efaea96ef10cbdbc5f8251e (diff)
downloadmruby-00062780882ad54f800b19412a1412bb864109b8.tar.gz
mruby-00062780882ad54f800b19412a1412bb864109b8.zip
move Array#[] tests from mrbgems to test/t/array.rb
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 5e745354f..54c3f2bde 100644
--- a/test/t/array.rb
+++ b/test/t/array.rb
@@ -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