From efc3b42c15240b752939b2b0af7f6f8842e82299 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 18 Jan 2000 06:09:05 +0000 Subject: 2000-01-18 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index e23c39f5e..53783d145 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -343,7 +343,7 @@ ok(($x * 5).join(":") == '1:1:1:1:1') ok(($x * 1).join(":") == '1') ok(($x * 0).join(":") == '') -*$x = 1..7 +*$x = (1..7).to_a ok($x.size == 7) ok($x == [1, 2, 3, 4, 5, 6, 7]) @@ -716,8 +716,11 @@ ok(a == 1 && b == 2 && c == 3 && d == 4) *a = 1, 2, 3 ok(a == [1, 2, 3]) -*a = 1..3 # array conversion -ok(a == [1, 2, 3]) +*a = 4 +ok(a == [4]) + +*a = nil +ok(a == []) check "call" def aaa(a, b=100, *rest) @@ -1042,7 +1045,7 @@ test = struct_test.new(1, 2) ok(test.foo == 1 && test.bar == 2) ok(test[0] == 1 && test[1] == 2) -a, b = test +a, b = test.to_a ok(a == 1 && b == 2) test[0] = 22 -- cgit