1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Framework for writing tests with randomly generated test data.
//!
//! For more information see the [guide].
//!
//! [guide]: https://jakoschiko.github.io/dicetest
//!
//! # Example
//!
//! ```no_run
//! use dicetest::prelude::*;
//!
//! #[test]
//! fn result_of_sort_is_sorted() {
//! Dicetest::repeatedly().run(|mut fate| {
//! let mut vec: Vec<u8> = fate.roll(die());
//! hint!("unsorted: {:?}", vec);
//!
//! vec.sort();
//! hint!(" sorted: {:?}", vec);
//!
//! let is_sorted = vec.windows(2).all(|w| w[0] <= w[1]);
//! assert!(is_sorted);
//! })
//! }
//! ```
//!
//! # Feature flags
//!
//! There are several feature flags for disabling runtime overhead or enabling additional
//! features at compile time.
//!
//! #### `derive` (disabled by default)
//!
//! If enabled, a derive macro for [`Dice`] is available.
//!
//! #### `hints` (enabled by default)
//!
//! Enables or disables the hints feature at compile time. If disabled,
//! all hints operations are no-ops.
//!
//! #### `stats` (enabled by default)
//!
//! Enables or disables the stats feature at compile time. If disabled,
//! all stats operations are no-ops.
// This allows us to add annotations to feature-gated items.
// This crate makes assumptions regarding the pointer width. The following conditional error
// prevents the compilation for unsupported pointer widths.
//
// See https://github.com/rust-lang/rfcs/issues/1748
compile_error!;
pub use Seed;
pub use Prng;
pub use Codie;
pub use Limit;
pub use Fate;
pub use DieOnce;
pub use Die;
pub use ;
pub use Dice;
pub use Dicetest;
// Test examples from the readme.
;