diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-10 04:49:57 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-10 04:49:57 -0800 |
| commit | e63c1e1d493bb97d4a299e2ab55c8aa6e46681e0 (patch) | |
| tree | a1f8bbe1b17f694406f965bc9dba8b19bb988d33 /mrbgems/mruby-array-ext/test | |
| parent | 3fff0e20258648a098477ed68661df07ab0d48dd (diff) | |
| parent | 921e6e24f4e87cf75827b6deba18fc7bbea48d5c (diff) | |
| download | mruby-e63c1e1d493bb97d4a299e2ab55c8aa6e46681e0.tar.gz mruby-e63c1e1d493bb97d4a299e2ab55c8aa6e46681e0.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.rb | 7 |
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 |
