diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-18 06:09:05 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-18 06:09:05 +0000 |
commit | e5ed1780afa9a5f29da7c63ca2b7d9c66f6936aa (patch) | |
tree | 02bb807e93fa0b9e53167165439d507c432b199b /sample | |
parent | dde62bcd2efbb3825d982326896ab774e73e4218 (diff) |
2000-01-18
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/test.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sample/test.rb b/sample/test.rb index e23c39f5e7..53783d145e 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 |