summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-01-10 04:49:57 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2014-01-10 04:49:57 -0800
commite63c1e1d493bb97d4a299e2ab55c8aa6e46681e0 (patch)
treea1f8bbe1b17f694406f965bc9dba8b19bb988d33 /mrbgems/mruby-array-ext/test
parent3fff0e20258648a098477ed68661df07ab0d48dd (diff)
parent921e6e24f4e87cf75827b6deba18fc7bbea48d5c (diff)
downloadmruby-1.0.0.tar.gz
mruby-1.0.0.zip
Merge pull request #1655 from pbosetti/master1.0.0
Added rewrite of Array#[] to mruby-array-ext gem
Diffstat (limited to 'mrbgems/mruby-array-ext/test')
-rw-r--r--mrbgems/mruby-array-ext/test/array.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb
index 1c441cec4..8a6f50fe4 100644
--- a/mrbgems/mruby-array-ext/test/array.rb
+++ b/mrbgems/mruby-array-ext/test/array.rb
@@ -107,3 +107,10 @@ 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