diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-30 10:33:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-30 10:33:47 +0900 |
| commit | 00062780882ad54f800b19412a1412bb864109b8 (patch) | |
| tree | e444b00182cc0657d6aa98c7c9e60b7575eb8b84 | |
| parent | 5346bdd76b3946a94efaea96ef10cbdbc5f8251e (diff) | |
| download | mruby-00062780882ad54f800b19412a1412bb864109b8.tar.gz mruby-00062780882ad54f800b19412a1412bb864109b8.zip | |
move Array#[] tests from mrbgems to test/t/array.rb
| -rw-r--r-- | mrbgems/mruby-array-ext/test/array.rb | 7 | ||||
| -rw-r--r-- | test/t/array.rb | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index 8a6f50fe4..1c441cec4 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -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 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 |
