|
1 | 1 | // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. |
2 | 2 |
|
3 | | -#[cfg(feature = "proptest-derive")] |
| 3 | +#[cfg(feature = "property-testing")] |
4 | 4 | use proptest::{arbitrary::any_with, collection::size_range}; |
5 | | -#[cfg(feature = "proptest-derive")] |
| 5 | +#[cfg(feature = "property-testing")] |
6 | 6 | use proptest_derive::Arbitrary; |
7 | 7 | use std::ops::{ |
8 | 8 | Bound, Deref, DerefMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive, |
9 | 9 | }; |
10 | 10 | use std::{fmt, str, u8}; |
11 | 11 |
|
12 | | -#[cfg(feature = "proptest-derive")] |
| 12 | +#[cfg(feature = "property-testing")] |
13 | 13 | const PROPTEST_KEY_MAX: usize = 1024 * 2; // 2 KB |
14 | | -#[cfg(feature = "proptest-derive")] |
| 14 | +#[cfg(feature = "property-testing")] |
15 | 15 | const PROPTEST_VALUE_MAX: usize = 1024 * 16; // 16 KB |
16 | 16 |
|
17 | 17 | use crate::{Error, Result}; |
@@ -65,10 +65,10 @@ impl<'a> fmt::Display for HexRepr<'a> { |
65 | 65 | /// accept an `Into<Key>`, which means all of the above types can be passed directly to those |
66 | 66 | /// functions. |
67 | 67 | #[derive(Default, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] |
68 | | -#[cfg_attr(feature = "proptest-derive", derive(Arbitrary))] |
| 68 | +#[cfg_attr(feature = "property-testing", derive(Arbitrary))] |
69 | 69 | pub struct Key( |
70 | 70 | #[cfg_attr( |
71 | | - feature = "proptest-derive", |
| 71 | + feature = "property-testing", |
72 | 72 | proptest(strategy = "any_with::<Vec<u8>>((size_range(PROPTEST_KEY_MAX), ()))") |
73 | 73 | )] |
74 | 74 | Vec<u8>, |
@@ -186,10 +186,10 @@ impl fmt::Debug for Key { |
186 | 186 | /// accept an `Into<Value>`, which means all of the above types can be passed directly to those |
187 | 187 | /// functions. |
188 | 188 | #[derive(Default, Clone, Eq, PartialEq, Hash)] |
189 | | -#[cfg_attr(feature = "proptest-derive", derive(Arbitrary))] |
| 189 | +#[cfg_attr(feature = "property-testing", derive(Arbitrary))] |
190 | 190 | pub struct Value( |
191 | 191 | #[cfg_attr( |
192 | | - feature = "proptest-derive", |
| 192 | + feature = "property-testing", |
193 | 193 | proptest(strategy = "any_with::<Vec<u8>>((size_range(PROPTEST_VALUE_MAX), ()))") |
194 | 194 | )] |
195 | 195 | Vec<u8>, |
@@ -262,7 +262,7 @@ impl fmt::Debug for Value { |
262 | 262 | /// Many functions which accept a `KvPair` accept an `Into<KvPair>`, which means all of the above |
263 | 263 | /// types (Like a `(Key, Value)`) can be passed directly to those functions. |
264 | 264 | #[derive(Default, Clone, Eq, PartialEq)] |
265 | | -#[cfg_attr(feature = "proptest-derive", derive(Arbitrary))] |
| 265 | +#[cfg_attr(feature = "property-testing", derive(Arbitrary))] |
266 | 266 | pub struct KvPair(Key, Value); |
267 | 267 |
|
268 | 268 | impl KvPair { |
|
0 commit comments