summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-19 07:33:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-19 07:33:10 +0000
commit058888bd38fb6ff3f32423390e0d62732f79e5a6 (patch)
tree50b70711344e7f857885a78c0423263a965306af /sample/test.rb
parenta74a6b0d911fd586f5e9cc5d1f2831d3521e4ae9 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@1529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/sample/test.rb b/sample/test.rb
index ed2ebcf..6bbe9ec 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 }