From 9ca1fec41b62d40d9cf3b6034e6364290592a7ee Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 1 May 2007 09:47:24 +0000 Subject: * sample/test.rb: import matzruby's sample/test.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index cf2e3a2493..7200ad41bf 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -134,13 +134,13 @@ def f; yield [[]]; end; f {|a| test_ok(a == [[]])} def f; yield [*[]]; end; f {|a| test_ok(a == [])} def f; yield [*[1]]; end; f {|a| test_ok(a == [1])} def f; yield [*[1,2]]; end; f {|a| test_ok(a == [1,2])} -def f; yield *[]; end; f {|a| test_ok(a == [])} -def f; yield *[1]; end; f {|a| test_ok(a == [1])} -def f; yield *[nil]; end; f {|a| test_ok(a == [nil])} -def f; yield *[[]]; end; f {|a| test_ok(a == [[]])} -def f; yield *[*[]]; end; f {|a| test_ok(a == [])} -def f; yield *[*[1]]; end; f {|a| test_ok(a == [1])} -def f; yield *[*[1,2]]; end; f {|a| test_ok(a == [1,2])} +def f; yield *[]; end; f {|a| test_ok(a == nil)} +def f; yield *[1]; end; f {|a| test_ok(a == 1)} +def f; yield *[nil]; end; f {|a| test_ok(a == nil)} +def f; yield *[[]]; end; f {|a| test_ok(a == [])} +def f; yield *[*[]]; end; f {|a| test_ok(a == nil)} +def f; yield *[*[1]]; end; f {|a| test_ok(a == 1)} +def f; yield *[*[1,2]]; end; f {|a| test_ok(a == 1)} def f; yield; end; f {|a,| test_ok(a == nil)} def f; yield nil; end; f {|a,| test_ok(a == nil)} @@ -156,7 +156,7 @@ def f; yield [*[1,2]]; end; f {|a,| test_ok(a == 1)} def f; yield *[]; end; f {|a,| test_ok(a == nil)} def f; yield *[1]; end; f {|a,| test_ok(a == 1)} def f; yield *[nil]; end; f {|a,| test_ok(a == nil)} -def f; yield *[[]]; end; f {|a,| test_ok(a == [])} +def f; yield *[[]]; end; f {|a,| test_ok(a == nil)} def f; yield *[*[]]; end; f {|a,| test_ok(a == nil)} def f; yield *[*[1]]; end; f {|a,| test_ok(a == 1)} def f; yield *[*[1,2]]; end; f {|a,| test_ok(a == 1)} @@ -164,14 +164,14 @@ def f; yield *[*[1,2]]; end; f {|a,| test_ok(a == 1)} def f; yield; end; f {|*a| test_ok(a == [])} def f; yield nil; end; f {|*a| test_ok(a == [nil])} def f; yield 1; end; f {|*a| test_ok(a == [1])} -def f; yield []; end; f {|*a| test_ok(a == [])} -def f; yield [1]; end; f {|*a| test_ok(a == [1])} -def f; yield [nil]; end; f {|*a| test_ok(a == [nil])} -def f; yield [[]]; end; f {|*a| test_ok(a == [[]])} -def f; yield [1,2]; end; f {|*a| test_ok(a == [1,2])} -def f; yield [*[]]; end; f {|*a| test_ok(a == [])} -def f; yield [*[1]]; end; f {|*a| test_ok(a == [1])} -def f; yield [*[1,2]]; end; f {|*a| test_ok(a == [1,2])} +def f; yield []; end; f {|*a| test_ok(a == [[]])} +def f; yield [1]; end; f {|*a| test_ok(a == [[1]])} +def f; yield [nil]; end; f {|*a| test_ok(a == [[nil]])} +def f; yield [[]]; end; f {|*a| test_ok(a == [[[]]])} +def f; yield [1,2]; end; f {|*a| test_ok(a == [[1,2]])} +def f; yield [*[]]; end; f {|*a| test_ok(a == [[]])} +def f; yield [*[1]]; end; f {|*a| test_ok(a == [[1]])} +def f; yield [*[1,2]]; end; f {|*a| test_ok(a == [[1,2]])} def f; yield *[]; end; f {|*a| test_ok(a == [])} def f; yield *[1]; end; f {|*a| test_ok(a == [1])} @@ -195,7 +195,7 @@ def f; yield [*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])} def f; yield *[]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])} def f; yield *[1]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])} def f; yield *[nil]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])} -def f; yield *[[]]; end; f {|a,b,*c| test_ok([a,b,c] == [[],nil,[]])} +def f; yield *[[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])} def f; yield *[*[]]; end; f {|a,b,*c| test_ok([a,b,c] == [nil,nil,[]])} def f; yield *[*[1]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,nil,[]])} def f; yield *[*[1,2]]; end; f {|a,b,*c| test_ok([a,b,c] == [1,2,[]])} @@ -965,23 +965,23 @@ IterTest.new([1]).each1 {|x| test_ok(x == 1)} IterTest.new([2]).each2 {|x| test_ok(x == [2])} #IterTest.new([3]).each3 {|x| test_ok(x == 3)} IterTest.new([4]).each4 {|x| test_ok(x == 4)} -IterTest.new([5]).each5 {|x| test_ok(x == [5])} +IterTest.new([5]).each5 {|x| test_ok(x == 5)} IterTest.new([6]).each6 {|x| test_ok(x == [6])} #IterTest.new([7]).each7 {|x| test_ok(x == 7)} IterTest.new([8]).each8 {|x| test_ok(x == 8)} IterTest.new([[0]]).each0 {|x| test_ok(x == [0])} -IterTest.new([[1]]).each1 {|x| test_ok(x == 1)} -IterTest.new([[2]]).each2 {|x| test_ok(x == [2])} +IterTest.new([[1]]).each1 {|x| test_ok(x == [1])} +IterTest.new([[2]]).each2 {|x| test_ok(x == [[2]])} IterTest.new([[3]]).each3 {|x| test_ok(x == 3)} IterTest.new([[4]]).each4 {|x| test_ok(x == [4])} IterTest.new([[5]]).each5 {|x| test_ok(x == [5])} -IterTest.new([[6]]).each6 {|x| test_ok(x == [6])} -IterTest.new([[7]]).each7 {|x| test_ok(x == [7])} +IterTest.new([[6]]).each6 {|x| test_ok(x == [[6]])} +IterTest.new([[7]]).each7 {|x| test_ok(x == 7)} IterTest.new([[8]]).each8 {|x| test_ok(x == [8])} -IterTest.new([[0,0]]).each0 {|*x| test_ok(x == [0,0])} -IterTest.new([[8,8]]).each8 {|*x| test_ok(x == [8,8])} +IterTest.new([[0,0]]).each0 {|*x| test_ok(x == [[0,0]])} +IterTest.new([[8,8]]).each8 {|*x| test_ok(x == [[8,8]])} def m0(v) v @@ -1074,8 +1074,8 @@ test_ok(block_get(&lmd).class == Proc) test_ok(Proc.new{|a,| a}.yield(1,2,3) == 1) call_argument_test(true, Proc.new{|a,|}, 1,2) -#! test_ok(Proc.new{|&b| b.call(10)}.call {|x| x} == 10) -#! test_ok(Proc.new{|a,&b| b.call(a)}.call(12) {|x| x} == 12) +test_ok(Proc.new{|&b| b.call(10)}.call {|x| x} == 10) +test_ok(Proc.new{|a,&b| b.call(a)}.call(12) {|x| x} == 12) def test_return1 Proc.new { -- cgit v1.2.3