summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-07-03 07:06:51 +0000
commitab801dbdb7ff8a99b5e0976516b879b27bcf3e1b (patch)
tree2657a1ca78c166beda5dfb609f9c53c5bae6f85c /sample
parent1a2003d1f176001f4c691d14a080e722bb12fc7b (diff)
1.1b9_29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index e3ca832e0f..9f1a92a0eb 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -517,7 +517,12 @@ ok($good)
$good = true;
for i in 4000..4096
n1 = 1 << i;
- $good = false if ((n1**2-1) / (n1+1) != (n1-1))
+ if (n1**2-1) / (n1+1) != (n1-1)
+ p i
+ p (n1**2-1)/(n1+1)
+ p (n1-1)
+ $good = false
+ end
end
ok($good)
@@ -897,6 +902,13 @@ rescue
ok true
end
+check "marshal"
+$x = [1,2,3,[4,5,"foo"],{1=>"bar"},2.5,fact(30)]
+$y = Marshal.dump($x)
+p $x
+p Marshal.load($y)
+ok($x == Marshal.load($y))
+
check "pack"
$format = "c2x5CCxsdila6";