diff options
Diffstat (limited to 'sample/test.rb')
-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 1106053c10..8f9805f60a 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 |