@@ -3274,7 +3274,7 @@ pub mod testing {
3274
3274
use proptest:: prelude:: * ;
3275
3275
use proptest:: sample:: select;
3276
3276
3277
- pub fn arb_retention_flags ( ) -> impl Strategy < Value = RetentionFlags > {
3277
+ pub fn arb_retention_flags ( ) -> impl Strategy < Value = RetentionFlags > + Clone {
3278
3278
select ( vec ! [
3279
3279
RetentionFlags :: EPHEMERAL ,
3280
3280
RetentionFlags :: CHECKPOINT ,
@@ -3291,7 +3291,7 @@ pub mod testing {
3291
3291
) -> impl Strategy < Value = Tree < A :: Value , V :: Value > >
3292
3292
where
3293
3293
A :: Value : Clone + ' static ,
3294
- V :: Value : Hashable + Clone + ' static ,
3294
+ V :: Value : Clone + ' static ,
3295
3295
{
3296
3296
let leaf = prop_oneof ! [
3297
3297
Just ( Tree ( Node :: Nil ) ) ,
@@ -3313,9 +3313,25 @@ pub mod testing {
3313
3313
} )
3314
3314
}
3315
3315
3316
+ pub fn arb_prunable_tree < H : Strategy + Clone + ' static > (
3317
+ arb_leaf : H ,
3318
+ depth : u32 ,
3319
+ size : u32 ,
3320
+ ) -> impl Strategy < Value = PrunableTree < H :: Value > >
3321
+ where
3322
+ H :: Value : Clone + ' static ,
3323
+ {
3324
+ arb_tree (
3325
+ proptest:: option:: of ( arb_leaf. clone ( ) . prop_map ( Rc :: new) ) ,
3326
+ ( arb_leaf, arb_retention_flags ( ) ) ,
3327
+ depth,
3328
+ size,
3329
+ )
3330
+ }
3331
+
3316
3332
/// Constructs a random shardtree of size up to 2^6 with shards of size 2^3. Returns the tree,
3317
3333
/// along with vectors of the checkpoint and mark positions.
3318
- pub fn arb_shardtree < H : Strategy > (
3334
+ pub fn arb_shardtree < H : Strategy + Clone > (
3319
3335
arb_leaf : H ,
3320
3336
) -> impl Strategy <
3321
3337
Value = (
@@ -3366,7 +3382,7 @@ pub mod testing {
3366
3382
} )
3367
3383
}
3368
3384
3369
- pub fn arb_char_str ( ) -> impl Strategy < Value = String > {
3385
+ pub fn arb_char_str ( ) -> impl Strategy < Value = String > + Clone {
3370
3386
let chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
3371
3387
( 0usize ..chars. len ( ) ) . prop_map ( move |i| chars. get ( i..=i) . unwrap ( ) . to_string ( ) )
3372
3388
}
0 commit comments