From cecaed6f4af527cde4ab03eb61baeb397cd96b5e Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 31 Oct 2000 08:37:47 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sample') 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 -- cgit