proptest
Hypothesis-like property-based testing and shrinking.
1.11.0
173M downloads/mo
#560 most downloaded on crates.io
proptest-rs/proptest
What this package is like to depend on
Last release 5 months ago
24 Mar 2026
Release timing varies
gaps range from 5 weeks to 2.0 years
Nearly every release is documented
notes for 47 of 48 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
48 releases · first in 2017
4 releases in the last 12 months
see the full history below
Release timeline
48 releases · Jun 2017 to Mar 2026Releases
latest 48-
1.11.024 Mar 2026 -
1.10.005 Feb 2026Release notes
Open source →Breaking Changes
- The minimum supported Rust version has been increased to 1.84.0. (#612)
New Features
- Added a memory-efficient strategy for sampling subsets from ranges without replacement. (#586)
Other Notes
-
1.9.026 Oct 2025Release notes
Open source →Breaking Changes
- The minimum supported Rust version has been increased to 1.82.0. (#605)
New Features
- Added
ProptestResultExttrait withprop_assume_okhelper method for convertingResulttypes to test outcomes. (#589)
Other Notes
-
1.8.020 Sep 2025 -
1.7.007 Jun 2025Release notes
Open source →Other Notes
- Updated
randdependency from 0.8 to 0.9. - Bump all dependencies to latest compatible with MSRV 1.66.
- Updated
-
1.6.016 Dec 2024Release notes
Open source →New Features
- Added
handle-panicsfeature which enables catching panics raised in tests and turning them into failures. (#525) - Exit early if shrink disabled. (#520)
- Add
Config::with_failure_persistence. A convenience constructor making use of a generic parameter overFailurePersistenceimpls and hiding theSome(Box::new(...)). (#508) - Add From's for SizeRange and Probability. (#498)
- When running persisted regressions, the most recently added regression is now run first. (#496)
Bug Fixes
- Fix WebAssembly support. Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation. (#519)
- Fix incorrectly reading environment configuration. Previously controlling
proptest configuration via env vars was not properly applied. This caused
vars like
PROPTEST_MAX_DEFAULT_SIZE_RANGEto be not be properly applied, leading to unexpected behavior. (#457) - Allow trailing comma in prop_assert_eq/ne like std. (#510)
Other Notes
- Added
-
1.5.022 Jun 2024Release notes
Open source →New Features
- Setting
PROPTEST_MAX_DEFAULT_SIZE_RANGEnow customizes the defaultSizeRangeused by the default strategies for collections (likeVec). The default remains 100. - Empty ranges panic during tree creation instead of during sampling.
Documentation
- Reference the derive macro in Arbitrary's documentation
- Fix broken links in the book
Bug Fixes
- Fixed issue where config contextualization would clobber existing failure persistence config
- Setting
-
1.4.010 Nov 2023Release notes
Open source →Breaking Changes
- The minimum supported Rust version has been increased to 1.65.0.
Other Notes
regex-syntaxupdated from 0.7 to 0.8- Fixed new clippies
- Fixed nightly build where Generator was renamed to Coroutine
-
1.3.101 Oct 2023Release notes
Open source →Other Notes
bit-setupdated from 0.5.0 to 0.5.2 to ensure minimum compatible version with bit-vec 0.6
-
1.3.030 Sep 2023Release notes
Open source →Breaking Changes
- The minimum supported Rust version has been increased to 1.64.0.
New Features
- Adds Arbitrary impl for PathBuf
- Permit use of (?-u) in byte-regex strategies, allowing non-utf-8 bytes to be generated
Book
- Various small fixes -- typos, formatting
- Removal of custom theme
- Add book page for Tips and Best Practices
Other Notes
regex-syntaxversion 0.7 is now used.- Print a seed to stderr for a failed test even when a regressions file is already present.
- Fixed a performance issue with
VarBitSet::saturatedthat can slow downVecStrategy - Remove use of rust feature
core_intrinsics - Remove no longer needed "break-dead-code" feature
- Disable
clippy::arc_with_non_send_sync - Remove dependency on
byteorder
-
1.2.023 May 2023Release notes
Open source →Breaking Changes
PROPTEST_environment variables now take precedence over tests' non-default configuration.
Bug Fixes
- Don't implement Arbitrary for NonZeroU128 and NonZeroI128 on wasm targets where u128 and i128 Arbitrary impls don't exist
New Features
Other Notes
- Minimal failing input is now printed using debug pretty-printing
- Made public
VarBitSet,SizeRangeread-only methods and num sampling functions in preparation for release of aproptest-state-machinecrate. - Removed dependency on
quick_error - Start publishing MSRV
-
1.1.005 Feb 2023Release notes
Open source →Bug Fixes
- Sampling from large ranges of floats such as
(0f32)..no longer panics with newer versions of therandcrate - [dependencies.x86] was bumped to latest current version. x86 crate does was on a very old version 0.33.0 which used a removed macro from rust.
- The calculation for the arbitrary impl of Layout was using a max_size that was too large and overflowing Layout. This has been fixed.
- Test for arbitrary AllocError was referring to AllocErr which does not exist, this was fixed.
- NoneError has been removed from rust so it was subsequently removed from proptest. It was blocking compilation. evidence: https://github.com/rust-lang/rust/issues/85614
try_reserveis stable so removed from unstable featurestry_traithas been changed totry_trait_v2so that was adjusted inCargo.toml.prop_assert_ne!now uses fully qualifiedprop_assert_eq!- Persisted tests are not counted against the number of cases to run
New Features
- Add
Arbitraryimpls for arrays of all sizes using const generics - Add
Arbitraryimpls forcore::num::NonZero* - Adds ability to disable failure persistence via env var
PROPTEST_DISABLE_FAILURE_PERSISTENCE
Other Notes
proptestno longer depends on thequick-errorcrate.
- Sampling from large ranges of floats such as
-
1.0.021 Feb 2021Release notes
Open source →Breaking Changes
-
The minimum supported Rust version has been increased to 1.50.0.
-
The version of the
randcrate has been increased to 0.8. -
Due to changes in the
getrandomcrate, if you wish to use proptest on thewasm32-unknown-unknowntarget, you must manually add a dependency on that crate and enable a feature that will allow it to work. Refer to thegetrandomcrate documentation for more information.
Bug Fixes
prop_shuffle()can now produce all permutations.
New Features
- Tuple strategies up to 12 elements are now supported, for parity with the
blanket implementations that
stdprovides.
-
-
0.10.115 Aug 2020Release notes
Open source →New Features
- Added
RngAlgorithm::Recorderand supporting APIs which allow capturing random data generated as part of generating a value or running a test.
- Added
-
0.10.028 May 2020Release notes
Open source →Breaking Changes
-
The version of the
randcrate has been increased to 0.7. -
The
proptest!macro no longer accepts function bodies which implicitly return a value (which would then be discarded). -
The
TupleUnionimplementation inproptest0.9 has been removed and replaced withLazyTupleUnion.prop_oneof!is unaffected and continues to be the recommended way to build a union of strategies.
New Features
-
Enabling the
hardware-rngoptional dependency (disabled by default) allows obtaining non-deterministic random seeds even inno_stdenvironments provided the architecture is x86 or AMD64. -
Added missing
?Sizedbound toBon the implementation ofArbitraryforstd::borrow::Cow<'_, B>.
Bug Fixes
prop_assert!andprop_assume!should now be usable inno_stdenvironments.
Other Notes
-
rusty_forkhas been bumped to 0.3.0, which adds support for a number of new test flags when running forked tests. -
The
PassThroughRNG algorithm now returns 0 instead of panicking when it runs out of entropy.
-
-
0.9.611 Apr 2020 -
0.9.517 Jan 2020Release notes
Open source →Bug Fixes
- Fixed a Rust future-compatibility issue (https://github.com/rust-lang/rust/pull/65819).
New Additions
-
0.9.409 Jun 2019Release notes
Open source →Bug Fixes
- The
unstablefeature one again works against the latest nightly.
Performance Improvements
-
Unions and the
prop_oneof!combinator now generate value trees lazily.In previous versions of
proptest, if a value tree for a union variant was generated, so would value trees for earlier variants -- as a result, union value tree generation was linear in the number of variants.In
proptest0.9.4 and above, value trees are only generated for union variants that are picked. Union value tree generation is now independent of the number of variants.
Deprecations
TupleUnionhas been deprecated, and its implementation will be replaced byLazyTupleUnion's in 0.10.0.
Other Notes
-
The return type of
prop_oneof!has changed fromTupleUniontoLazyTupleUnion.prop_oneof!'s return type is documented to not be stable, and that continues to be the case. -
Shrinking is now limited to four times as many iterations as configured number of test cases by default.
-
prop_assert_eq!andprop_assert_ne!produce output more similar to theassert_eq!andassert_ne!macros. This should also make it easier to visually parse out the source location in the resulting messages.
- The
-
0.9.328 Apr 2019Release notes
Open source →This is a minor release to correct some packaging errors. The license files are now included in the files published to crates.io, and some unneeded files are now excluded.
-
0.9.224 Mar 2019Release notes
Open source →New Additions
-
Closures generated by
prop_compose!are nowmove. This is not expected to cause any breakage since there is no way to successfully use a borrowing closure with that macro. -
There is now highly experimental support for building on Web Assembly. Refer to the Proptest book for build instructions.
Other Notes
-
Using proptest with the default
stdfeature enabled, thespincrate is no longer brought in as a dependency. -
Using proptest with the
stdfeature disabled, neitherspinnorlazy_staticare brought in as dependencies.
-
-
0.9.111 Feb 2019Release notes
Open source →New RNG Algorithm
Starting in this version, the default RNG algorithm has been changed from XorShift to ChaCha since it produces higher-quality randomness. This may make test case generation a bit slower but it avoids certain pathological cases that the old generator had.
The old algorithm is still supported, and is used automatically when reading old failure persistence files.
Note that this change also affects the internal representation of RNG seeds, which affects the
FailurePersistencetrait which previously only supported the seed representation for XorShift. This release maintains source compatibility with 0.9.0 by providing defaults for the new methods which delegate (when possible) to the old ones, but be aware that custom failure persistence implementations using the old API will not function when using an RNG other than XorShift.To keep using the old algorithm, you can set the environment variable
PROPTEST_RNG_ALGORITHMtoxsor setConfig.rng_algorithmtoRngAlgorithm::XorShiftin code.Besides ChaCha, this version also adds a
PassThroughRNG "algorithm" which makes it possible to use an external source of entropy with Proptest.New Additions
-
TestRnginstances can be created with thefrom_seedfunction. -
TestRunnerinstances can be created with user-providedTestRngs. -
TestRunnernow has adeterministic()constructor which uses the same RNG every time, to facilitate doing statistical tests on strategy outputs. -
There is now a work-around for a compiler bug which prevents building with
-C link-dead-code. Please see this issue for details: https://github.com/proptest-rs/proptest/issues/124
Deprecations
- The
load_persisted_failuresandsave_persisted_failuremethods on theFailurePersistencetrait have been deprecated and will be removed in 0.10.0.
-
-
0.9.004 Feb 2019Release notes
Open source →Breaking Changes
-
The minimum Rust version has been increased to 1.32.0.
-
The version of the
randcrate has been increased to 0.6. -
The
ValueFortype alias (deprecated in 0.8.0) has been removed. ReplaceValueFor<S>withS::Valueor<S as Strategy>::Valueas necessary. -
From<SizeRange>implementations converting aSizeRangeback to various std types have been removed since they were of limited utility and had unclear or incorrect conversion properties. -
Many optional elements (such as trailing commas or function visibility modifiers) in certain macros could be specified more than once. The macros now accept at most one occurrence.
-
Visibility modifiers inside
prop_composemust no longer be enclosed in brackets. Unless other modifiers (e.g.,unsafe) are also in use, simply removing the brackets is sufficient.
New Additions
-
Rust 2018 style macro imports are now supported.
-
In a Rust 2018 crate, all the macros can be brought into scope with
import proptest::prelude::*;. -
The proptest macros now accept trailing commas in more locations.
-
Visibility modifiers can now be passed to
prop_compose!without enclosing them in brackets. Unfortunately, the old way could not continue to be supported due to the way thevismacro matcher works.
Nightly-only breakage
-
The
nightlyfeature, which was formerly required for using proptest with#[no_std], has been removed. References to the feature can simply be deleted. -
When using the
unstablefeature and settingdefault-features = false, theAtomicI64andAtomicU64types are not supported unless theatomic64bitfeature is enabled. This supportsno_stdusage on platforms which do not support atomic 64-bit operations.
Other Notes
-
Generated strings are now much more likely to contain right-to-left override characters.
-
Most of the crate-level documentation has been relocated to the Proptest Book.
-
-
0.8.723 Sep 2018Release notes
Open source →New Additions
-
Add
max_shrink_itersandmax_shrink_timeoptions to test configuration to allow capping the resources expended on shrinking test cases. -
Add
verboseoption to make proptest give details about what is happening as the test executes. -
When a failure is saved to the persistence file, the message now also includes the seed that was saved so that it can manually be added to the appropriate file should the test have run somewhere where the updated file is not accessible (for example, on a CI system).
Bug Fixes
any::<SystemTime>()now generates random values centred on the UNIX epoch rather than always producing the current time.
Other Notes
- When using forking, proptest will now detect conditions which cause the child process to crash without running any tests, and will fail quickly instead of respawning child processes.
-
-
0.8.627 Aug 2018Release notes
Open source →New Additions
-
Vec<S> where S: Strategyis now itself aStrategyfor producing fixed-sizeVecs whose values are derived from the respective strategies. -
It is now possible to configure the test runner to cache test results to avoid spending time running identical tests. See
Config.result_cache. -
Add
sample::Index, a type for generating indices into runtime-sized slices and vectors. -
Add
sample::Selector, a type for picking items out of dynamically-created iterables.
Bug Fixes
-
Fix panic when using
sample::subsequencewith an empty vector. -
Fix panic when using
sample::subsequencewith a size equal to the size of the input vector. -
Fix sampled bitset strategies on integers not allowing to generate exactly the same number of bits as the integer is wide.
Other Notes
-
Passing empty size ranges to functions requiring a non-empty size range now panic with an explicit message immediately rather than causing an arithmetic error when generating input values.
-
There were a few cases where proptest would accept a
SizeRangewith an inclusive maximum value ofusize::MAX. Size ranges are now always clamped tousize::MAX - 1.
-
-
0.8.522 Aug 2018 -
0.8.428 Jul 2018Release notes
Open source →Bug Fixes
- Nightly and no_std support work against latest nightly once again.
New Additions
- Added
bits::bool_vecfor generatingVec<bool>as a bit set.
Nightly-only breakage
-
impl Arbitrary for CollectionAllocErris temporarily removed pending it being available outside thealloccrate again. -
bits::bitsetis no longer available without thebit-setfeature (enabled by default), which is not compatible with#[no_std]environments.
-
0.8.304 Jul 2018Release notes
Open source →Bug Fixes
- Fix that regex-based string generation could transpose the order of a literal and a non-literal component.
-
0.8.230 Jun 2018Release notes
Open source →New Additions
-
Macros which previously accepted
pattern in strategysyntax to specify arguments now also acceptpattern: typesyntax as shorthand forpattern in any::<type>(). -
Closure-style
proptest!invocation no longer requires the body to use block syntax. -
Closure-style
proptest!invocation now accepts custom configurations.
-
-
0.8.127 Jun 2018Release notes
Open source →New Additions
proptest!now has form that accepts a closure. See the documentation for the macro for more details.
Bug Fixes
-
Fix spurious warning about corrupt regression files. The files were not corrupt but the parser was failing to handle the blank line at the end.
-
The
multiplex_alloc!andmultiplex_core!macros which were unintentionally exported in 0.8.0 are no longer exported. This is not considered a breaking change since they were not supposed to be accessible, and in any case would not have expanded into valid code in most other crates.
-
0.8.024 Jun 2018Release notes
Open source →New Additions
-
A combinator
.prop_filter_maphas been added toStrategy. It is similar to.filter_mapforIteratorin that it is the combination of.prop_filterand.prop_map. -
i128andu128are now supported without any feature flags and on stable. -
More implementations of
Arbitraryare supported foralloc+no_stdusers. -
size_rangenow accepts inclusive ranges of formlow..=highand..=high. Thus, you can construct avecstrategy as:vec(elt_strategy, low..=high)andvec(elt_strategy, ..=high). This also applies to other functions acceptingInto<SizeRange>. -
..= highis now a valid strategy. Please note that..= 1will naturally include numbers lower than0for sized types. -
low..=highis also a valid strategy. -
Arbitraryis implemented forRangeInclusive<Idx>,RangeToInclusive, andDecodeUtf16on stable. -
Bitset strategies and
subsequencenow accept all range syntaxes.
Bug Fixes
- Fix a race condition where a test failing due to running ever so slightly over the set timeout could cause the test harness to converge to the incorrect failing value, a non-failing value, or panic.
Deprecations
- The type alias
ValueFor<S>is now deprecated and will be removed in version 0.9. You should just useS::Valueinstead.
Breaking changes
-
A minimum version of 1.27 of Rust is now required.
-
regex-syntaxversion 0.6 is now used. -
randversion 0.5 is now used. -
As a consequence, the
FailurePersistencetrait will now use[u8; 16]seeds instead of[u32; 4]. However, the stored failure persistence files using the defaultFileFailurePersistencewill still use[u32; 4]so your old failure persistence files should still work. -
The RNG used by proptest has been changed to a PRNG
TestRngwhich proptest exposes. This is currently a simple new-type wrapper aroundXorShiftRng. In the future, this will give us more freedom to make changes without breakage. -
The feature flag
i128_supporthas been removed. The features it added are now always supported. -
The associated type
ValueofStrategyhas been renamed toTree. A new associated typeValuehas been added toStrategywhich always refers to the same type as<S::Tree as ValueTree>::Valuefor some strategyS. This change allows you to write-> impl Strategy<Value = T>for functions returning aStrategygeneratingTs. This is more ergonomic to use than-> impl Strategy<Value = impl ValueTree<Value = T>>. -
The method
new_valueinStrategyhas been renamed tonew_treeto mirror the renaming ofValuetoTree. -
As a consequence change, the associated type
ValueTreehas been removed fromArbitrary. -
The methods
runandrun_oneonTestRunnernow takes a function-under-test that accepts the generated type by value instead of by reference instead. This means that you don't need to writeref value in my_strategyand can writevalue in my_strategyinstead even iftypeof(value)doesn't implementCopy. This is also a step in the direction of allowing strategies to generate references when generic associated types (GATs) land. However,ref value in my_strategywill still be accepted, so not a lot of breakage should come of this if you've usedproptest! { .. }. -
prop_compose!no longer applies.boxed()to the strategy produced. Therefore,-> BoxedStrategy<T>is no longer the correct type. The new return type is-> impl Strategy<Value = T>. If you want the old behaviour, you can use.boxed()yourself. -
ArbitraryforSizeRangechanged its associated type to useRangeInclusive. Same applies forCString. -
Many APIs now use
impl Traitin argument position, which could affect code using turbofishes to specify types explicitly. -
charAPIs which formerly represented a range as(start, end)now requirestart..=end.
Nightly-only breakage
- As
std::io::{Chars, CharsError}have been deprecated on nightly, theirArbitraryimplementations have been removed.
-
-
0.7.220 Jun 2018Release notes
Open source →Bug Fixes
- Fix that
boolwould not shrink correctly, leading to hangs when tests takingboolparameters would fail in certain circumstances.
- Fix that
-
0.7.102 Jun 2018Release notes
Open source →New Additions
-
It is now possible to run test cases in sub-processes. This allows using proptest to test functions which may cause the test process to terminate abruptly, such as by calling
abort()or even suffering a segmentation fault. This requires the "fork" feature, enabled by default. -
Added support for setting a timeout which applies on a per-test-case (i.e., single input rather than the whole test) basis. This allows using proptest to find inputs which cause code to get stuck in infinite loops or exhibit other pathological performance behaviour. This requires the "timeout" feature (and transitively, the "fork" feature), enabled by default.
See also the documentation for these features.
Bug Fixes
-
Fix that failure persistence file would be written to the incorrect location in projects using workspaces. See #24 for more details and instructions on how to migrate any persistence files that had been written to the wrong location.
-
Fix a case where
any::<ArgsOs>()orany::<VarsOs>()could panic on Windows.
Nightly-only breakage
- Support for the
hashmap_corecrate is removed pending https://github.com/Amanieu/hashmap_core/issues/3.
-
-
0.7.003 May 2018Release notes
Open source →Potential Breaking Changes
-
The persistence system has been refactored to allow for non-file-system based persistence.
FailurePersistenceis now a trait, and the prior file-based enum which fulfilled that purpose is now calledFileFailurePersistenceand implements the generic trait. The default behavior has not changed. -
Reflecting the change to persistence,
Config.failure_persistenceis now of typeOption<Box<FailurePersistence>>. -
The
source_fileused as an optional reference point to the location of the calling test is now tracked on theConfigstruct rather than theTestRunner.
New Additions
- Experimental support on nightly for working in
#![no_std]environments has been added. To use it, one must disable the default-features for proptest and use the new "alloc" and "nightly" features. Currently access to a heap allocator is still required.
-
-
0.6.016 Apr 2018Release notes
Open source →Potential Breaking Changes
- There is a small change of breakage if you've relied on
Recursiveusing anArc<BoxedStrategy<T>>asRecursivenow internally usesBoxedStrategy<T>instead as well as expecting aFn(BoxedStrategy<T>) -> Rinstead ofFn(Arc<BoxedStrategy<T>>) -> R. In addition, the type of recursive strategies has changed fromRecursive<BoxedStrategy<T>, F>to justRecursive<T, F>.
Minor changes
-
Reduced indirections and heap allocations inside
Recursive<T, F>somewhat. -
BoxedStrategy<T>andSBoxedStrategy<T>now useArcinternally instead of usingBox. While this has marginal overhead, it also reduces the overhead inRecursive<T, F>. The upside to this change is also that you can very cheaply clone strategies. -
Filteris marginally faster.
Bug Fixes
-
Removed
impl Arbitrary for LocalKeyStatesinceLocalKeyStateno longer exists in the nightly compiler. -
Unstable features compile on latest nightly again.
- There is a small change of breakage if you've relied on
-
0.5.124 Feb 2018Release notes
Open source →New Additions
-
proptest::strategy::Unionandproptest::strategy::TupleUnionnow work with weighted strategies even if the sum of the weights overflows au32. -
Added
SIGNALING_NANstrategy to generate signalling NaNs if supported by the platform. Note that this is not included inANY.
Bug Fixes
-
Fixed values produced via
prop_recursive()not shrinking from the recursive to the non-recursive case. -
Fix that
QUIET_NANwould generate signalling NaNs on most platforms on Rust 1.24.0 and later.
-
-
0.5.017 Feb 2018Release notes
Open source →Potential Breaking Changes
-
There is a small chance of breakage if you've relied on the constraints put on type inference by the closure in
leaf.prop_recursive(..)having a fixed output type. The output type is now any strategy that generates the same type asleaf. This change is intended to make working with recursive types a bit easier as you no longer have to use.boxed()inside the closure you pass to.prop_recursive(..). -
There is a small chance of breakage wrt. type inference due to the introduction of
SizeRange. -
There is a small chance of breakage wrt. type inference due to the introduction of
Probability. -
BoxedStrategyandSBoxedStrategyare now newtypes instead of being type aliases. You will only experience breaking changes if you've directly used.boxed()and not(S)BoxedStrategy<T>but ratherBox<Strategy<Value = Box<ValueTree<Value = T>>>>. The probability of breakage is very small, but still possible. The benefit of this change is that calling.boxed()or.sboxed()twice only boxes once. This can happen in situations where you have functionsStrategy -> BoxedStrategyor with code generation. -
proptest::char::ANYhas been removed. Any remaining uses must be replaced byproptest::char::any(). -
proptest::strategy::Singletonhas been removed. Any remaining uses must be replaced byproptest::strategy::Just.
New Additions
-
Proptest now has an
Arbitrarytrait inproptest::arbitraryand re-exported in theproptest::prelude.Arbitraryhas also beenimplemented for most of the standard library. The trait provides a mechanism to define a canonicalStrategyfor a given type just likeArbitraryin Haskell's QuickCheck. Deriving for this trait will also be provided soon in the crateproptest_derive. To use the canonical strategy for a certain typeT, you can simply useany::<T>(). This is the major new addition of this release. -
The
any_with,arbitrary,arbitrary_withfree functions in the moduleproptest::arbitrary. -
The
ArbitraryF1andArbitraryF2traits inproptest::arbitrary::functor. These are "higher order"Arbitrarytraits that correspond to theArbitrary1andArbitrary2type classes in Haskell's QuickCheck. They are mainly provided to support a common set of container-like types in custom deriving self-recursive types inproptest_derive. More on this later releases. -
The strategies in
proptest::optionandproptest::resultnow accept a typeProbabilitywhich is a wrapper aroundf64. Conversions from types such asf64are provided to make the interface ergonomic to use. Users may also use theproptest::option::probfunction to explicitly construct the type. -
The strategies in
proptest::collectionsnow accept a typeSizeRangewhich is a wrapper aroundRange<usize>. Conversions from types such asusizeandRange<usize>are provided to make the interface ergonomic to use. Users may also use theproptest::collections::size_boundsfunction to explicitly construct the type. -
A
.prop_map_into()operation on all strategies that map usingInto<OutputType>. This is a clearer and cheaper operation than using.prop_map(OutputType::from). -
A nonshrinking
LazyJuststrategy that can be used instead ofJustwhen you have non-Clonetypes. -
Anything that can be coerced to
fn() -> TwhereT: Debugis aStrategywhereValueFor<fn() -> T> == T. This is intended to make it easier to reuse proptest for unit tests with manual input space partition wherefn() -> Tprovides fixtures.
Minor changes
-
Relaxed the constraints of
btree_mapremoving'static. -
Reduced the heap allocation inside
Recursivesomewhat.
-
-
0.4.221 Jan 2018 -
0.4.120 Jan 2018Release notes
Open source →New Additions
- The
proptest::num::f32andproptest::num::f64modules now have additional constants (e.g.,POSITIVE,SUBNORMAL,INFINITE) which can be used to generate subsets of the floating-point domain by class and sign.
Bug Fixes
proptest::num::f32::ANYandproptest::num::f64::ANYnow actually produce arbitrary values. Previously, they had the same effect as0.0..1.0. While this fix is a very substantial change in behaviour, it was not considered a breaking change since (a) the new behaviour is consistent with the documentation and expectations, (b) it's quite unlikely anyone was depending on the old behaviour since anyone who wanted that range would have written it out, and (c) Proptest isn't generally a transitive dependency so the chance of this update happening "by surprise" is low.
- The
-
0.4.015 Jan 2018Release notes
Open source →Deprecations and Potential Breaking Changes
-
proptest::char::ANYreplaced withproptest::char::any().proptest::char::ANYis present but deprecated, and will be removed in proptest 0.5.0. -
Instead of returning
-> Result<Self::Value, String>, strategies are expected to return-> Result<Self::Value, Reason>instead.Reasonreduces the amount of heap allocations, especially for.prop_filter(..)where you may now also pass in&'static str. You will only experience breaks if you've written your own strategy types or if you've usedTestCaseError::RejectorTestCaseError::Failexplicitly. -
Update of externally-visible crate
randto0.4.2.
New Additions
-
Added
proptest::test_runner::Reasonwhich allows you to avoid heap allocation in some places and may be used to make the API richer in the future without incurring more breaking changes. -
Added a type alias
proptest::strategy::NewTree<S>whereS: Strategydefined as:type NewTree<S> = Result<<S as Strategy>::Value, Rejection>.
-
-
0.3.406 Jan 2018Release notes
Open source →Bug Fixes
- Cases where
file!()returns a relative path, such as on Windows, are now handled more reasonably. See #24 for more details and instructions on how to migrate any persistence files that had been written to the wrong location.
- Cases where
-
0.3.326 Dec 2017Release notes
Open source →Boxing Day Special
New Additions
-
Added support for
i128andu128. Since this is an unstable feature in Rust, this is hidden behind the featureunstablewhich you have to explicitly opt into in yourCargo.tomlfile. -
Failing case persistence. By default, when a test fails, Proptest will now save the seed for the failing test to a file, and later runs will test the persisted failing cases before generating new ones.
-
Added
UniformArrayStrategyand helper functions to simplify generating homogeneous arrays with non-Copyinner strategies. -
Trait
rand::Rngand structrand::XorShiftRngare now included inproptest::prelude.
Bug Fixes
- Fix a case where certain combinations of strategies, like two
prop_shuffle()s in close proximity, could result in low-quality randomness.
-
-
0.3.209 Dec 2017Release notes
Open source →New Additions
-
Added
SampledBitSetStrategyto generate bit sets based on size distribution. -
Added
Strategy::sboxed()andSBoxedStrategyto makeSend + Syncboxed strategies. -
RegexGeneratorStrategyis nowSendandSync. -
Added a type alias
ValueFor<S>whereS: Strategy. This is a shorter way to refer to:<<S as Strategy>::Value as ValueTree>::Value. -
Added a type alias
type W<T> = (u32, T)for a weighted strategyTin the context of union strategies. -
TestRunnernow implementsDefault. -
Added
Config::with_cases(number_of_cases: u32) -> Configfor simpler construction of aConfigthat only differs by the number of test cases. -
All default fields of
Configcan now be overridden by setting environment variables. See the docs of that struct for more details. -
Bumped dependency
rand = "0.3.18". -
Added
proptest::sample::subsequencewhich returns a strategy generating subsequences, of the sourceVec, with a size within the givenRange. -
Added
proptest::sample::selectwhich returns a strategy selecting exactly one value from another collection. -
Added
prop_perturbstrategy combinator. -
Added
strategy::check_strategy_sanity()function to do sanity checks on the shrinking implementation of a strategy. -
Added
prop_shufflestrategy combinator. -
Added
strategy::Fuseadaptor.
Bug Fixes
-
Fix bug where
Vec, array and tuple shrinking could corrupt the state of their inner values, for example leading to out-of-range integers. -
Fix bug where
Flatten(a.k.a. theprop_flat_mapcombinator) could fail to converge to a failing test case during shrinking. -
Fix
TupleUnionsometimes panicking during shrinking if there were more than two choices.
-
-
0.3.119 Sep 2017 -
0.3.017 Sep 2017Release notes
Open source →New Additions
-
Unionnow supports weighting viaUnion::new_weighted. Corresponding syntax to specify weights is also available inprop_oneof!. -
Added
TupleUnion, which works likeUnionbut permits doing static dispatch even with heterogeneous delegate strategies. -
prop_oneof!is smarter about how it combines the input strategies. -
Added
optionmodule to generate weighted or unweightedOptiontypes. -
Added
resultmodule to generate weighted or unweightedResulttypes. -
All
bitssubmodules now have amaskedfunction to create a strategy for generating subsets of an arbitrary bitmask.
Potential Breaking Changes
-
Union::newnow has a generic argument type which could impact type inference. -
The concrete types produced by
prop_oneof!have changed. -
API functions which used to return
BoxedStrategynow return a specific type. -
BitSetStrategy<T>is no longerCopyfor non-CopytypesTnorDebugfor non-DebugtypesT. -
BitSetLike::maxhas been renamed toBitSetLike::len.
-
-
0.2.120 Aug 2017Release notes
Open source →New Additions
-
Added
prop_assert!macro family to assert without panicking, for quieter test failure modes. -
New
preludemodule for easier importing of important things. -
Renamed
SingletontoJust. (The old name is still available.) -
Failure messages produced by
proptest!are now much more readable. -
Added in-depth tutorial.
-
-
0.2.014 Aug 2017Release notes
Open source →Breaking Changes
Strategynow requiresstd::fmt::Debug.
New Additions
-
Strategynow has a family ofprop_flat_map()combinators for producing dynamic and higher-order strategies. -
Strategyhas aprop_recursive()combinator which allows generating recursive structures. -
Added
proptest::bool::weighted()to pull booleans from a weighted distribution. -
New
prop_oneof!macro makes it easier to select from one of several strategies. -
New
prop_compose!macro to simplify writing most types of custom strategies.
-
0.1.105 Aug 2017 -
0.1.018 Jun 2017Nothing published for this version