diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-10-31 08:37:47 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-10-31 08:37:47 +0000 |
| commit | cecaed6f4af527cde4ab03eb61baeb397cd96b5e (patch) | |
| tree | 8aa0738f21319dc82e0403a4f065f831a907ebcc /sample | |
| parent | 7e953f2d81f7a68abdd711180b56246b5d1a83dc (diff) | |
| download | ruby-cecaed6f4af527cde4ab03eb61baeb397cd96b5e.tar.gz ruby-cecaed6f4af527cde4ab03eb61baeb397cd96b5e.tar.xz ruby-cecaed6f4af527cde4ab03eb61baeb397cd96b5e.zip | |
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
| -rw-r--r-- | sample/test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb index 1106053c1..8f9805f60 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -385,6 +385,18 @@ $z = [1,2] $y[$z] = 256 test_ok($y[$z] == 256) +$x = [1,2,3] +$x[1,0] = $x +test_ok($x == [1,1,2,3,2,3]) + +$x = [1,2,3] +$x[-1,0] = $x +test_ok($x == [1,2,1,2,3,3]) + +$x = [1,2,3] +$x.concat($x) +test_ok($x == [1,2,3,1,2,3]) + test_check "iterator" test_ok(!iterator?) @@ -571,7 +583,6 @@ def fact(n) end return f end -fact(3) $x = fact(40) test_ok($x == $x) test_ok($x == fact(40)) @@ -613,6 +624,7 @@ $good = true; for i in 4000..4096 n1 = 1 << i; if (n1**2-1) / (n1+1) != (n1-1) + p i $good = false end end |
