From 00062780882ad54f800b19412a1412bb864109b8 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 30 Jan 2014 10:33:47 +0900 Subject: move Array#[] tests from mrbgems to test/t/array.rb --- mrbgems/mruby-array-ext/test/array.rb | 7 ------- 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 -- cgit v1.2.3