summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-31 08:37:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-31 08:37:47 +0000
commitc90b1ecaf81868ab64b014401ea75eb45da2c5d0 (patch)
tree8aa0738f21319dc82e0403a4f065f831a907ebcc /sample/test.rb
parent5f4d324d3b7f9f50c7c1eb2ec6d2b546e4466f0b (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 1106053..8f9805f 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