diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-19 07:33:10 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-19 07:33:10 +0000 |
commit | fb61968dcf1abeb675a0e8a7dbb6d555c37e71b2 (patch) | |
tree | 50b70711344e7f857885a78c0423263a965306af /sample | |
parent | 8064f8fbecaec992f4fae035deb17ad458708a6c (diff) | |
download | ruby-fb61968dcf1abeb675a0e8a7dbb6d555c37e71b2.tar.gz ruby-fb61968dcf1abeb675a0e8a7dbb6d555c37e71b2.tar.xz ruby-fb61968dcf1abeb675a0e8a7dbb6d555c37e71b2.zip |
* eval.c (svalue_to_mvalue): new function to convert from svalue
to mvalue. [experimental]
* eval.c (mvalue_to_svalue): new function to convert from mvalue
to svalue.
* eval.c (rb_eval): use mvalue_to_svalue().
* eval.c (rb_yield_0): use mvalue_to_svalue().
* eval.c (proc_invoke): proper mvalue handling.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/test.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sample/test.rb b/sample/test.rb index ed2ebcf15..6bbe9ecba 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -56,8 +56,8 @@ a = *nil; test_ok(a == nil) a = *1; test_ok(a == 1) a = *[]; test_ok(a == nil) a = *[1]; test_ok(a == 1) -a = *[nil]; test_ok(a == nil) -a = *[[]]; test_ok(a == []) +a = *[nil]; test_ok(a == [nil]) +a = *[[]]; test_ok(a == [[]]) a = *[*[]]; test_ok(a == nil) a = *[*[1]]; test_ok(a == 1) a = *[*[1,2]]; test_ok(a == [1,2]) @@ -76,8 +76,8 @@ a = *[*[1,2]]; test_ok(a == [1,2]) *a = *1; test_ok(a == [1]) *a = *[]; test_ok(a == []) *a = *[1]; test_ok(a == [1]) -*a = *[nil]; test_ok(a == []) -*a = *[[]]; test_ok(a == []) +*a = *[nil]; test_ok(a == [nil]) +*a = *[[]]; test_ok(a == [[]]) *a = *[*[]]; test_ok(a == []) *a = *[*[1]]; test_ok(a == [1]) *a = *[*[1,2]]; test_ok(a == [1,2]) @@ -97,7 +97,7 @@ a,b,*c = *1; test_ok([a,b,c] == [1, nil, []]) a,b,*c = *[]; test_ok([a,b,c] == [nil, nil, []]) a,b,*c = *[1]; test_ok([a,b,c] == [1, nil, []]) a,b,*c = *[nil]; test_ok([a,b,c] == [nil, nil, []]) -a,b,*c = *[[]]; test_ok([a,b,c] == [nil, nil, []]) +a,b,*c = *[[]]; test_ok([a,b,c] == [[], nil, []]) a,b,*c = *[*[]]; test_ok([a,b,c] == [nil, nil, []]) a,b,*c = *[*[1]]; test_ok([a,b,c] == [1, nil, []]) a,b,*c = *[*[1,2]]; test_ok([a,b,c] == [1, 2, []]) @@ -116,8 +116,8 @@ 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 == 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 *[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,2])} @@ -136,8 +136,8 @@ def f; yield *nil; end; f {|*a| test_ok(a == [])} 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 == [])} -def f; yield *[[]]; end; f {|*a| test_ok(a == [])} +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])} @@ -157,7 +157,7 @@ def f; yield *1; end; f {|a,b,*c| test_ok([a,b,c] == [1, 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 *[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, 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 *[*[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, []])} @@ -644,7 +644,7 @@ test_ok($x == 0) IterTest.new([1]).each1 { |x| $x = x } test_ok($x == 1) IterTest.new([2]).each2 { |x| $x = x } -test_ok($x == [2]) +test_ok($x == [2]); p $x IterTest.new([3]).each3 { |x| $x = x } test_ok($x == 3) IterTest.new([4]).each4 { |x| $x = x } @@ -663,11 +663,11 @@ test_ok($x == [0]) IterTest.new([[1]]).each1 { |x| $x = x } test_ok($x == 1) IterTest.new([[2]]).each2 { |x| $x = x } -test_ok($x == [2]) +test_ok($x == [2]); p $x IterTest.new([[3]]).each3 { |x| $x = x } test_ok($x == 3) IterTest.new([[4]]).each4 { |x| $x = x } -test_ok($x == [4]) +test_ok($x == [4]); p $x IterTest.new([[5]]).each5 { |x| $x = x } test_ok($x == 5) IterTest.new([[6]]).each6 { |x| $x = x } |