]> gitweb.factorcode.org Git - factor.git/commitdiff
serialize, test cells around first 2000 powers of 2
authorJon Harper <jon.harper87@gmail.com>
Fri, 7 Aug 2015 23:19:14 +0000 (01:19 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 8 Aug 2015 03:29:23 +0000 (20:29 -0700)
basis/serialize/serialize-tests.factor

index 92591acbf2f668b634b83602db1d169c0aa0e028..0dfa1ee051fca58c26c20d24bc31e5b118596363 100644 (file)
@@ -9,11 +9,14 @@ combinators.short-circuit ;
 SPECIALIZED-ARRAY: double
 IN: serialize.tests
 
-: test-serialize-cell ( a -- ? )
-    2^ random dup
+: (test-serialize-cell) ( n -- ? )
+    dup
     binary [ serialize-cell ] with-byte-writer
     binary [ deserialize-cell ] with-byte-reader = ;
 
+: test-serialize-cell ( a -- ? )
+    2^ random (test-serialize-cell) ;
+
 { t } [
     100 [
         drop
@@ -26,6 +29,11 @@ IN: serialize.tests
     ] all-integers?
 ] unit-test
 
+{ t } [ 2000 [
+        2^ 3 [ 1 - + (test-serialize-cell) ] with all-integers?
+    ] all-integers?
+] unit-test
+
 TUPLE: serialize-test a b ;
 
 C: <serialize-test> serialize-test