Released YYYY-MM-DD.
- TODO (or remove section if none)
- TODO (or remove section if none)
- TODO (or remove section if none)
- TODO (or remove section if none)
- TODO (or remove section if none)
- TODO (or remove section if none)
Released 2023-10-30.
- Added
Arbitrary
implementations forArc<[T]>
andRc<[T]>
. #160
Released 2023-10-11.
- Fixed an issue with generating collections of collections in
arbitrary_take_rest
where<Vec<Vec<u8>>>::arbitrary_take_rest
would never generatevec![vec![]]
for example. See #159 for details.
Released 2023-03-13.
- Added the ability to manually specify derived trait bounds for
Arbitrary
. See #138 for details.
- Fixed minimal versions correctness for
syn
.
Released 2023-01-20.
- The
derive(Arbitrary)
will now annotate the generatedimpl
s with a#[automatically_derived]
attribute to indicate to e.g. clippy that lints should not fire for the code within the derived implementation.
Released 2023-01-03.
- Ensured that
arbitrary
andderive_arbitrary
versions are synced up so that they don't, e.g., emit generated code that depends on newer versions ofarbitrary
than the one currently in use. #134
- Fixed an issue where
std::thread_local!
macro invocations in derive code were not fully prefixed, causing confusing build errors in certain situations.
Released 2022-10-20.
- Support custom arbitrary implementation for fields on derive. #129
Released 2022-09-20.
- Fixed a potential panic due to an off-by-one error in the
Arbitrary
implementation forstd::ops::Bound<T>
.
Released 2022-09-08.
- Implemented
Arbitrary
forstd::ops::Bound<T>
.
- Fixed a bug where
Unstructured::int_in_range
could return out-of-range integers when generating arbitrary signed integers.
Released 2022-08-29.
- Implemented
Arbitrary
forRc<str>
andArc<str>
- Allow overriding the error type in
arbitrary::Result
- The
Unstructured::arbitrary_loop
method will consume fewer bytes of input now.
- Fixed a bug where
Unstructured::int_in_range
could return out-of-range integers.
Released 2022-06-23.
- Fixed some potential (but highly unlikely) name-clashes inside
derive(Arbitrary)
's generated code. #111 - Fixed an edge case where
derive(Arbitrary)
for recursive types that detected an overflow would not reset the overflow detection. #111
Released 2022-06-16.
- Fixed a warning inside
derive(Arbitrary)
-generated code. #110
Released 2022-06-14.
- Fixed a stack overflow when using
derive(Arbitrary)
with recursive types and empty inputs. #109
Released 2022-02-09.
-
Added the
Unstructured::ratio
method to generate a boolean that istrue
at the given rate. -
Added the
Unstructured::arbitrary_loop
method to call a function an arbitrary number of times.
Released 2021-11-20.
- Fixed documentation for
Unstructured::fill_bytes
. We forgot to update this way back in #53 when the behavior changed.
Released 2021-08-25.
Arbitrary
impls forHashMap
s andHashSet
s with customHasher
s #87
Released 2021-05-20.
Arbitrary
impls forNonZeroX
types #79Arbitrary
impls for all arrays using const generics #55Arbitrary
impls forIpv4Addr
andIpv6Addr
#84
Released 2020-02-24.
See 1.0.0-rc1 and 1.0.0-rc2 for changes since 0.4.7, which was the last main line release.
Released 2021-02-09.
- The
Arbitrary
trait is now implemented for&[u8]
. #67
- Rename
Unstructured#get_bytes
toUnstructured#bytes
. #70 - Passing an empty slice of choices to
Unstructured#choose
returns an error. Previously it would panic. 71
Released 2020-11-25.
- The
Arbitrary
trait is now implemented for&str
. #63
- The
Arbitrary
trait now has a lifetime parameter, allowingArbitrary
implementations that borrow from the raw input (e.g. the new&str
implementaton). Thederive(Arbitrary)
macro also supports derivingArbitrary
on types with lifetimes now. #63
-
The
shrink
method on theArbitrary
trait has been removed.We have found that, in practice, using internal reduction via approaches like
cargo fuzz tmin
, where the raw input bytes are reduced rather than theT: Arbitrary
type constructed from those raw bytes, has the best efficiency-to-maintenance ratio. To the best of our knowledge, no one is relying on or using theArbitrary::shrink
method. If you are using and relying on theArbitrary::shrink
method, please reach out by dropping a comment here and explaining how you're using it and what your use case is. We'll figure out what the best solution is, including potentially adding shrinking functionality back to thearbitrary
crate.
Released 2020-10-14.
-
Added an optimization to avoid unnecessarily consuming bytes from the underlying data when there is only one possible choice in
Unstructured::{int_in_range, choose, etc..}
. -
Added license files to the derive crate.
- The
Arbitrary
implementation forstd::time::Duration
should now be faster and produce durations with a more-uniform distribution of nanoseconds.
Released 2020-08-22.
- Added the
Unstructured::peek_bytes
method.
-
Test case reduction via
cargo fuzz tmin
should be much more effective at reducing the sizes of collections now. (See #53 and the commit messages for details.) -
Fuzzing with mutation-based fuzzers (like libFuzzer) should be more efficient now. (See #53 and the commit messages for details)
Released 2020-06-18.
- Implement
Arbitrary
for zero length arrays. - Implement
Arbitrary
forRange
andRangeInclusive
.
Released 2020-04-29.
- Fixed the custom derive for enums when used via its full path (like
#[derive(arbitrary::Arbitrary)]
rather than like#[derive(Arbitrary)]
).
Released 2020-04-28.
- Fixed the custom derive when used via its full path (like
#[derive(arbitrary::Arbitrary)]
rather than like#[derive(Arbitrary)]
).
Released 2020-04-17.
- We forgot to release a new version of the
derive_arbitrary
crate last release. This release fixes that and so thesynstructure
dependency is finally actually removed in the cargo releases.
Released 2020-03-18.
- Removed an internal dependency on the
synstructure
crate when thederive
feature is enabled. This should not have any visible downstream effects other than faster build times!
Released 2020-01-22.
This is technically a breaking change, but we expect that nearly everyone should
be able to upgrade without any compilation errors. The only exception is if you
were implementing the Arbitrary::size_hint
method by hand. If so, see the
"changed" section below and the API docs for
Arbitrary::shrink
for details.
- Added the
arbitary::size_hint::recursion_guard
helper function for guarding against infinite recursion insize_hint
implementations for recursive types.
- The
Arbitrary::size_hint
signature now takes adepth: usize
parameter. This should be passed along unmodified to any nested calls of othersize_hint
methods. If you're implementingsize_hint
for a recursive type (like a linked list or tree) or a generic type with type parameters, you should use the newarbitrary::size_hint::recursion_guard
helper function.
- Fixed infinite recursion in generated
size_hint
implementations from#[derive(Arbitrary)]
for recursive types.
Released 2020-01-16.
- Updated the custom derive's dependencies.
Released 2020-01-15.
- Fixed an over-eager assertion condition in
Unstructured::int_in_range
that would incorrectly trigger when given valid ranges of length one.
Released 2020-01-14.
- Fixed some links and version numbers in README.
Released 2020-01-14.
- Added the
"derive"
cargo feature, to enable#[derive(Arbitrary)]
for custom types. Enabling this feature re-exports functionality from thederive_arbitrary
crate. - The custom derive for
Arbitrary
implements the shrink method for you now. - All implementations of
Arbitrary
forstd
types implement shrinking now. - Added the
Arbitrary::arbitrary_take_rest
method allows anArbitrary
implementation to consume all of the rest of the remaining raw input. It has a default implementation that forwards toArbitrary::arbitrary
and the custom derive creates a smart implementation for your custom types. - Added the
Arbitrary::size_hint
method for hinting how many raw bytes an implementation needs to construct itself. This has a default implementation, but the custom derive creates a smart implementation for your custom types. - Added the
Unstructured::choose
method to choose one thing among a set of choices. - Added the
Unstructured::arbitrary_len
method to get an arbitrary length for a collection of some arbitrary type. - Added the
Unstructured::arbitrary_iter
method to create an iterator of arbitrary instance of some type.
- The
Arbitrary
trait was simplified a bit. Unstructured
is a concrete type now, not a trait.- Switched to Rust 2018 edition.
RingBuffer
andFiniteBuffer
are removed. UseUnstructured
instead.
- Better
Arbitrary
implementation forchar
. - Better
Arbitrary
implementation forString
.