serialize, test cells around first 2000 powers of 2
parent
a51f2a32d0
commit
b5c3252d1d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue